Skip Navigation

[Gelöst] Product Layout – Display text conditionally based on product ID page viewed

This support ticket is created vor 4 Jahre, 5 Monate. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Minesh vor 4 Jahre, 5 Monate.

Assisted by: Minesh.

Author
Artikel
#1369165

Tell us what you are trying to do?

I want to show "This is on sale" on product page of product id 928 and I want to show "This is discontinued" on product page of product id 918. I want to achieve this in the layout for products using conditional rules.

Is there any documentation that you are following?NO

Is there a similar example that we can see?Not sure

#1369607

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can use the conditional shortcode as given under to display conditional output based on your product ID.

[wpv-conditional if="( '[wpv-post-id]' eq '928' )"]
This is on sale
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-id]' eq '918' )"]
This is discontinued
[/wpv-conditional]

More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

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