Browser: Chrome 115
OS: Windows
Hi bricks team,
I tried to display sale and regular price in the product loop using two new DDs. But regular price and sale price are not displayed for variable products.
Browser: Chrome 115
OS: Windows
Hi bricks team,
I tried to display sale and regular price in the product loop using two new DDs. But regular price and sale price are not displayed for variable products.
Hi Jolia,
This is correct as a variable product has many variations.
Each variation can set different prices, which variation price should be output as the regular and sale price?
For your information, we were using the standard WooCommerce function $product->get_regular_price()
and $product->get_sale_price()
for these 2 new dynamic tags.
When you are looping products, the $product in each iteration is the parent product, so no regular price and no sale price is expected and it’s the correct behaviour.
If you really need to show variation price, you might need to come out with your custom PHP function and logic (to decide with variation price) and use {echo:} to output it.
Hope this helps.
Regards,
Jenn
I don’t know Php and I don’t understand what you mean. But thanks anyway.