Home Forums WoodMart support forum variation product price show zero

variation product price show zero

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #567324

    av_admin_1984
    Participant

    Hi
    long time ago I asked here to remove price for out-of-stock products and now I have a problem in a variation product
    https://xtemos.com/forums/topic/remove-price-from-out-of-stock-products/
    https://xtemos.com/forums/topic/remove-price-and-sale-label-from-out-of-stock-products/

    in variation, show me the zero price in front
    check private area

    *I’m using the child theme which contains codes that I asked you for before, with the default theme there is no problem*
    Please don’t share anything in public

    you have access to this site on this topic, you can use it and check what is going on
    https://xtemos.com/forums/topic/page-speed-and-optimization-issue/

    Thanks

    #567491

    Hello,

    Sorry but there is no option in Theme Settings available for that.

    It requires additional customization which is out of our theme support scope.

    Regards.
    Xtemos Studios

    #567526

    av_admin_1984
    Participant

    I dont need option in theme settings

    Tell me why it shows zero on variable products?

    You give me php snippet

    Tell Me wich snippet have conflict whit variation price

    #567616

    Hello,

    I have checked our code and it is not conflicting with the price. Sorry but Additional code customizations in the child theme are out of our theme support scope.

    Hope you can understand!

    Best Regards.

    #567884

    av_admin_1984
    Participant

    I found that

    this was the problem in showing zero number of variation product

    /*change order of seal and promotion price */
    function pric_sale_price_html( $price, $product ) {
    if ( $product->is_on_sale() ) {
    $sale_price = wc_get_price_to_display( $product );
    $regular_price = $product->get_regular_price();
    $price = '<ins>' . wc_price( $sale_price ) . '</ins> <br>  <del>' . wc_price( $regular_price ) . '</del>';}
    return $price;}
    add_filter( 'woocommerce_get_price_html', 'pric_sale_price_html', 10, 2 );

    Now do you have a suggestion to change the order of seal and promotion?

    #567935

    Hello,

    Please remove the previous code add the below code to the functions.php file in the Child theme:

    function custom_pric_sale_price_html( $price, $product ) {
        if ( $product->is_on_sale() ) {
            $regular_price = wc_get_price_to_display( $product, array( 'price' => $product->get_regular_price() ) );
            $sale_price = wc_get_price_to_display( $product, array( 'price' => $product->get_sale_price() ) );
            $price = '<del>' . wc_price( $regular_price ) . '</del> <br> <ins>' . wc_price( $sale_price ) . '</ins>';
        }
        return $price;
    }
    add_filter( 'woocommerce_get_price_html', 'custom_pric_sale_price_html', 10, 2 );

    Best Regards.

    #568016

    av_admin_1984
    Participant

    I found this and this worked too

    function pric_sale_price_html( $price, $product ) {
    	if ( $product->is_on_sale() ) {
    		if ( $product->is_type( 'simple' ) ) {
    			$sale_price    =  $product->get_sale_price();
    			$regular_price =  $product->get_regular_price();}
    		elseif ( $product->is_type( 'variable' ) ) {
    			$sale_price    =  $product->get_variation_sale_price( 'min', true );
    			$regular_price =  $product->get_variation_regular_price( 'max', true );}
    	$price = '<ins>' . wc_price( $sale_price ) . '</ins> <br><del>' . wc_price( $regular_price ) . '</del>';}return $price;}
    add_filter( 'woocommerce_get_price_html', 'pric_sale_price_html', 10, 2 );

    But I replaced it with your code

    Close please

    #568020

    Sounds Great! that your issue has been solved.

    I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.

    We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

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

The topic ‘variation product price show zero’ is closed to new replies.