Home Forums WoodMart support forum Change price of product variation – Display online one price

Change price of product variation – Display online one price

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #490991

    g.nielsbakker
    Participant

    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.

    #491002

    g.nielsbakker
    Participant

    I only want to show the variation price because it’s otherwise too confusing for customers

    #491023

    g.nielsbakker
    Participant

    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;
    }

    #491101

    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.

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

The topic ‘Change price of product variation – Display online one price’ is closed to new replies.