T
T
trenton2021-04-25 18:11:58
WooCommerce
trenton, 2021-04-25 18:11:58

How to display the price of each variation, both regular and discounted?

I'm trying this way, but it doesn't work correctly. The minimum and maximum are displayed in general in the entire product, and not for each variation.

$min_regular_price = $product->get_variation_regular_price( 'min', true );
    $min_sale_price = $product->get_variation_sale_price( 'min', true );
    $max_regular_price = $product->get_variation_regular_price( 'max', true );
    $max_sale_price = $product->get_variation_sale_price( 'max', true );

Variations on the product page, but in a custom place, are displayed as if in a list with a price tag. Current price and crossed out without discount if there is a discount. It takes a long time to explain, but if necessary, I will try, and if this is not necessary for an answer about prices, then I will not ship.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question