Home Forums WoodMart support forum Product style promotional price is not displayed

Product style promotional price is not displayed

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #528898

    Grelo Zhang
    Participant

    I noticed that products without variations are showing sale prices
    Products with multiple variations do not show promotional prices

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

    Hello,

    If you want to hide sale price use this custom css code in Theme Settings > Custom CSS > Global Custom CSS:

    .price del {
        display: none;
    }

    Navigate to Theme Settings > Shop > Variable Products > Make sure that “Hide to price” option is disable:
    https://ibb.co/LQVwL9j

    Best Regards.

    #529108

    Grelo Zhang
    Participant

    I want to show the promotional price, not the hidden price, thank you

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

    Hello,

    Please add the below code to functions.php in the Child theme

    // For simple products.
    add_filter( 'woocommerce_format_sale_price', 'dcwd_sale_price', 20, 3 );
    function dcwd_sale_price( $price, $regular_price, $sale_price ) {
        /*global $product;
        // Show regular and sale price for specified product IDs
        if ( in_array( $product->get_id(), array( 1, 2, 3, 28 ) ) ) {
            return $price;
        }
        // Show regular and sale price if product is in any of the specified categories.
        if ( has_term( array( 'hoodies', 'accessories', 'tshirts' ), 'product_cat', $product->get_id() ) ) {
            return $price;
        }*/
    	
    	return wc_price( $sale_price );
    }
    
    // For variable products.
    add_filter( 'woocommerce_variable_price_html', 'dcwd_variable_price', 10, 2 );
    function dcwd_variable_price( $price_html, $product ) {
    	if ( $product->is_on_sale() ) {
            /*// Show regular and sale price for specified product IDs
            if ( in_array( $product->get_id(), array( 1, 2, 3, 7932 ) ) ) {
                return $price_html;
            }
            // Show regular and sale price if product is in any of the specified categories.
            if ( has_term( array( 'hoodies', 'accessories', 'tshirts' ), 'product_cat', $product->get_id() ) ) {
                return $price_html;
            }*/
    
    		$prices = $product->get_variation_prices( true ); 
    		$min_price = current( $prices['price'] );
    		$price = wc_price( $min_price ); 
    		return 'From: ' . $price;
    	}
    	return $price_html;
    }

    Best Regards.

    #529206

    Grelo Zhang
    Participant

    Nothing happened after I added the code

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

    Grelo Zhang
    Participant

    And the promotional prices on product pages disappeared.

    I want both original and promotional prices to be displayed.

    • This reply was modified 11 months ago by Grelo Zhang.
    Attachments:
    You must be logged in to view attached files.
    #529226

    Grelo Zhang
    Participant

    Attach pictures

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

    Hello,

    Can you please share the wp-login details I will check and give you a possible solution.

    Best Regards.

    #529400

    Grelo Zhang
    Participant

    Okay, thanks a lot for the help

    #529499

    Hello,

    You have not added the “sale price” in your products. You need to add “”sale price” in the products from the edit product page: https://ibb.co/YZDDFFT. When you add the sale price it will show the both regular and sale price.

    Best Regards.

    #529504

    Grelo Zhang
    Participant

    Sorry, I didn’t explain the question clearly. I recorded a video.
    As you can see in the video, the product page will display the promotional and selling prices. Still, the promotional price is not displayed when we return to the product category page to look at the “Archive Products”.

    #529562

    Hello,

    Navigate to Theme Settings > Shop > variable products > and disable the price option.
    https://ibb.co/HLct2xy

    Best Regards.

    #529574

    Grelo Zhang
    Participant

    Thanks for the reply. Please check it for me. I will send the content to private.

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

    Grelo Zhang
    Participant

    By deactivating both options, the products that initially disappeared from the product category page have now been restored to their original state.

    Would you like a parent product featuring various variations to be presented as “Show single variation”? This would enable the display of promotional prices.

    Ideally, I’d prefer parent products with multiple variations to also showcase sale prices. If the implementation is more troublesome, we can leave it unchanged for now.

    • This reply was modified 11 months ago by Grelo Zhang.
    Attachments:
    You must be logged in to view attached files.
    #529737

    Hello,

    Yes when you disable the options about “Price”. It will show the sale price and variations in price ranges.

    If you want to use show single variation check his documentation how it works and how to configure:
    https://xtemos.com/docs-topic/show-single-variation/

    Best Regards.

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