I am trying to: place a short code inside an condition
Link to a page where the issue can be seen: hidden link
I expected to see: the content of the the Shortcode
Instead, I got: the Shortcode itself.
Inside a layout for WooCommerce Products building with Divi WC Builder i have a problem with the toolset shortcodes.
First we found out that only content placed with square brackets was shown. https://toolset.com/forums/topic/only-shortcode-will-shown-if-use-of-divi-woolayout-incector-or-divi-wc-builder/
So now i place these shortcode inside square brackets inside an conditional Statement - also in Square brackets. But now the condition work as expected, buth the shortcode inside shows no content, but only the shortcode itself.
[wpv-conditional if="( $(wpcf-dauer) ne '' )"]
Test with the automatic generated ones also not helps:
{!{wpv-conditional if="( $(wpcf-dauer) ne '' )" debug="true"}!}
Dauer
[types field='dauer'][/types]
{!{/wpv-conditional}!}
It looks like a compatibility issue. Nested Toolset shortcodes do not seem to be supported in the Product layout when I use WooCommerce Builder for Divi. If I create a Layout directly in the Divi Library without using WooCommerce Builder for Divi, then apply that template to a Product, the following code works:
While I'm waiting to receive additional feedback, I encourage you to let the authors of the WooCommerce Builder for Divi plugin know you're experiencing an issue. I see a link to their support team here: https://www.divikingdom.com/contact/
i get feedback from the developer auf Divi WC Builder:
" I've done some testing and here what I got:
1- using the nested shortcodes inside the product content area ( the description builder ) works fine.
2- Using the nested shortcode in the layout in Divi Library, the conditional logic will work but the content will not be rendered correctly, it will be displayed as plain text.
I do not know why this is happening! But it has something to do with this file /plugins/wp-views/embedded/inc/wpv-conditional.php
function wpv_shortcode_wpv_conditional as this function returns the content as it is ( plain text ) without doing the shortcode.
Manually modifying the file fixed the issue, a screenshot is attached.
I don't know how the devs of Toolset plugin will fix this, for now, I suggest using these fields in the description builder and add the Woo Product description module to the layout in Divi Library.
- The way the Wc Builder works is that it applies the content of the Divi Library layout ( the content of Divi Layouts is basically shortcodes ) to the product via template_include filter that overrides the default template of WooCommerce, this could be helpful to Toolset devs."