NextGen IT

Display Price For Variable Product With Same Variations Prices

Home Forums Woocommerce Toolkit Display Price For Variable Product With Same Variations Prices

This topic contains 0 replies, has 1 voice, and was last updated by  Imran Morshed 2 years, 9 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2084

    Imran Morshed
    Keymaster

    On Woocommerce store, Sometimes we want product variation but with same price. Main problem is after selecting your variation it doesn’t display price. If we need to show price above add to cart button, please add following code to your Theme function.php (located at theme file)

    // Display Price For Variable Product With Same Variations Prices
    add_filter('woocommerce_available_variation', function ($value, $object = null, $variation = null) {
        if ($value['price_html'] == '') {
            $value['price_html'] = '<span class="price">' . $variation->get_price_html() . '</span>';
        }
        return $value;
    }, 10, 3);
     That’s it .
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Nextgen BD © 2017 . All rights reserved. Designed & Developed by SKILL TOUCH IT.