Change price of product variation – Display online one price
-
Currently, the product page displays 2 prices. Namely an original price and a variation price. I would like only one price to be shown.
See link (http://spectrumsolar.nl/product/100-cm-dubbelwandige-kachelpijp/) for current situation.
I have used several plugins that unfortunately do not get this done.
I only want to show the variation price because it’s otherwise too confusing for customers
Fixed it by myself
I’ve changed the php to
add_action(‘woocommerce_before_add_to_cart_form’, ‘selected_variation_price_replace_variable_price_range’);
function selected_variation_price_replace_variable_price_range(){
global $product;
if( $product->is_type(‘variable’) ):
?><style> .woocommerce-variation-price {display:none;} </style>
<script>
jQuery(function($) {
var p = ‘p.price’
q = $(p).html();
$(‘form.cart’).on(‘show_variation’, function( event, data ) {
if ( data.price_html ) {
$(p).html(data.price_html);
}
}).on(‘hide_variation’, function( event ) {
$(p).html(q);
});
});
</script>
<?php
endif;
}
Hello,
You are Most Welcome.
We are glad that you managed to solve the problem yourself. You are Great!!!
Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.
Have a wonderful day.
Topic Closed.
Best Regards.
The topic ‘Change price of product variation – Display online one price’ is closed to new replies.