Home Forums WoodMart support forum Display regular AND discount price for variation products on archive products

Display regular AND discount price for variation products on archive products

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #517429

    ecom.france35
    Participant

    Hello,

    On archive products, it show regular and discount price on products but for variable products, it show only discount price so I need to have both prices as on simple products.

    Thank you!

    Attachments:
    You must be logged in to view attached files.
    #517587

    Hello,

    Now on your site the variation price showing in range:
    https://ibb.co/v12HKvd

    Best Regards.

    #517595

    ecom.france35
    Participant

    No, I need to have both prices as on simple products so regular and discount…

    #517682

    Hello,

    Add below Custom code to functions.php file in Child theme.

    add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 ); function wc_wc20_variation_price_format( $price, $product ) { // Main Price $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); $price = $prices[0] !== $prices[1] ? sprintf( __( 'Price: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); // Sale Price $prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) ); sort( $prices ); $saleprice = $prices[0] !== $prices[1] ? sprintf( __( 'Previous Price: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '<ins>' . $price . '</ins> <del>' . $saleprice . '</del>'; } return $price; }

    Best Regards.

    #517708

    ecom.france35
    Participant

    Thank you! It need just some modification.

    I need to show as simple products :

    1) To the left, only the regular price crossed out.
    2) Then (to the right), only the discount price with primary color.

    #517709

    ecom.france35
    Participant

    See image below

    Attachments:
    You must be logged in to view attached files.
    #517802

    Hello,

    Sorry to say there are no options in theme settings available for that. Such modifications require complicated customization that is not covered by our support.

    Best Regards.

Viewing 7 posts - 1 through 7 (of 7 total)