Conditional button display

Hi, I wonder if you can help me please?

I have a many products, some have a manual, others a brochure, and some with neither of these. I’m using acf and have set up custom fields, one for the hyperlink to the manual and the other for a hyperlink to the brochure.

What I’m trying to do is set up conditional logic so that if item
a) has a manual
b) has a brochure and a manual
c) as a brochure and
d) has neither
Button(s) will appear on the product page dependant upon the type, one for a brochure, another for the manual, but nothing for the item that has neither.

I can call the links from the acf data but haven’t been successful with the buttons hiding or showing.

Thanks,
Ken

Hello Ken,

Thanks for writing to us.

To help you with your concerns we need to check your settings, I would request please share the admin login details. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact layout URL

You can find the Secure Note button at the bottom of your posts

Thanks

Hello Ken,

I would suggest you please go to the button and set the condition, for example, you have a button called “manual” where you have added the link PDF link in the backend. Now you need to set the condition like this.

{{dc:acf:post_field field="user_manual"}} is not blank. You need to set the conditions expression type as a string. Please have a look at the screenshot below.

Hope it helps
Thanks

Thank you! Perfect!!

You are most welcome, Ken.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.