Skip Navigation

[Resolved] Money format shortcode conflict problem with conditional shortcode

This support ticket is created 3 years, 4 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 3 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#1867259

Tell us what you are trying to do?

I am trying to use this shortcode in conditional logic
https://toolset.com/forums/topic/transforming-content-in-number-field-as-price/

Shortcode itself works, but if I use conditional logic shortcode with it, condition doesn't work.

Basically if custom filed "public-rent" has a value and not blank, it should show the value from public rent and in money format.(value can be numbers or text)
And if the value is empty, it should display "N/A." I think my logic is okay.
Please take a look,

[wpv-conditional if="( $(wpcf-public-rent) gte '0' ) AND ( $(wpcf-public-rent) ne '' )"]

[format_money price=ˮ[types field='public-rent' output='raw'][/types]ˮ]

[/wpv-conditional]
[wpv-conditional if="( $(wpcf-public-rent) eq '' )"]N/A[/wpv-conditional]

#1867465

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

I've tested the shortcode from the other thread ( ref: https://toolset.com/forums/topic/transforming-content-in-number-field-as-price/#post-611859 ) and it worked inside conditional blocks too.

I noticed that in the code that you've shared, the double-quotes ("") used in the shortcode nested in the first conditional block were different.

Can you please test using this code:


[wpv-conditional if="( $(wpcf-public-rent) gte '0' ) AND ( $(wpcf-public-rent) ne '' )"]
[format_money price="[types field='public-rent' output='raw'][/types]"]
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-public-rent) eq '' )"]N/A[/wpv-conditional]

regards,
Waqar

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