Skip Navigation

[Resolved] Conditional custom field buttons in Product Content Template

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by LukaszM 1 year, 7 months ago.

Assisted by: Shane.

Author
Posts
#2443293
Screenshot 2022-08-23 at 11.36.55.png
Screenshot 2022-08-23 at 11.41.24.png
Screenshot 2022-08-23 at 11.44.51.png

Hi,
I created custom field group for upload datasheets, manuals.
Also I have custom Content Template for single products.

Problem is not every product have manual file. I would like show download buttons only if there is url linked.
I found conditional container, but I got confused how to setup it to show single button in multiple buttons group if there is a url.

At the moment second button in Content Template generate product url to fill field if there is no url in current product.

#2443661

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lukas,

Thank you for getting in touch.

From your screenshot I see that you're using a conditional block. You should be able to use this to check if the field is not empty and then display your button.

Click on the Add new condition button from your screenshot in order to add your conditional to check the custom field.

Thanks,
Shane

#2443955

I managed use conditional blocks:
NOT (
Field Datasheet from Current Post is empty .
)

but I had to do single conditional per buttons group > button couldn't add conditions to single button in buttons group. Anyway it helps thanks.

Also I found that after I open content template editor I do not see source - custom fields at all. I have to reload content first -> view with: other product. After that I see source - custom fields

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.