This issue is related with my previously closed post
https://toolset.com/forums/topic/populate-woocommerce-product-prices-to-custom-fields/
I am not sure whether I will get respond if I continue to post in that post, so I create a new post here.
I defined following short code for extracting woocommerce product regular and sale prices.
function get_regular_price($atts) {
$price = money_format('%.2n', get_post_meta( get_the_ID(), '_regular_price', true));
return $price;
}
add_shortcode("regularprice", "get_regular_price");
function get_sale_price($atts) {
$price = money_format('%.2n', get_post_meta( get_the_ID(), '_sale_price', true));
return $price;
}
add_shortcode("saleprice", "get_sale_price");
Both the shortcodes '[regularprice]' and '[saleprice]' works great.
I already registered these two custom shortcodes in Views > Settings > Compatibility > 3rd Party Shortcodes.
Now I am trying to use conditional view output to handle the no-discount case, i.e. only regular price, no sale price.
I created a product with only regular price but no sale price. Then I add following conditional out:
[wpv-conditional if="( '[saleprice]' eq '' )"]
No sale
[/wpv-conditional]
If I put this wpv-conditional block inside a custom WYSIWYG field, it not only does not show anything, but also completely wipe out all existing content in the field. If I put it in a post body, it does not wipe out existing contents, but does not show anything.
Even though I put a sale price for the product, the wpv-conditional block still have same issue.
BTW, I feel your editor has an issue. When I click 'conditional output' button, some part of the popup window is blocked by the editor buttons, maybe meaning that your CSS z-index is not correctly set.