Home › Forums › WoodMart support forum › variation product price show zero
variation product price show zero
- This topic has 7 replies, 2 voices, and was last updated 3 weeks, 1 day ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
May 21, 2024 at 10:26 pm #567324
av_admin_1984ParticipantHi
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 publicyou 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
May 22, 2024 at 3:11 pm #567491
Aizaz Imtiaz AwanKeymasterHello,
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 StudiosMay 22, 2024 at 4:47 pm #567526
av_admin_1984ParticipantI 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
May 23, 2024 at 10:00 am #567616
Aizaz Imtiaz AwanKeymasterHello,
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.
May 23, 2024 at 11:34 pm #567884
av_admin_1984ParticipantI 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?
May 24, 2024 at 9:51 am #567935
Aizaz Imtiaz AwanKeymasterHello,
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.
May 24, 2024 at 2:44 pm #568016
av_admin_1984ParticipantI 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
May 24, 2024 at 2:52 pm #568020
Aizaz Imtiaz AwanKeymasterSounds 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. -
AuthorPosts
The topic ‘variation product price show zero’ is closed to new replies.
- You must be logged in to create new topics. Login / Register