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]
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