This topic contains 5 reply and 3 voices, and was last updated by abelljefrry 5 years, 6 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
April 25, 2014 at 8:15 pm 19408
abelljefrry Hello Wedevs Team, May I know how to remove the dashed discount price? Because it makes the price text longer and forced the cart button outside of the product thumbnail/tiles. Imagine if our user post a $XXXX.XX products, or even worst it's on sale. That would be a total disaster to Dokan theme layout. This issue can be seen in Dokan demo too, here's the screenshot: http://imgur.com/H0NGwWh.png http://imgur.com/94BgLzN.png Plus, I'm using the smart sale badge plugin, so it's OK for me to remove the before discount price. https://wordpress.org/plugins/woocommerce-smart-sale-badge/screenshots/
April 26, 2014 at 11:42 am 19436
Nizam Uddin Nizam Uddin

Hello
Thanks for pointing it out. I will forward it to our development team. Thank you..

April 28, 2014 at 7:04 pm 19532
Sk Sk

Please write the following code to your function.php file to remove dashed discount price.

add_filter( 'woocommerce_variable_sale_price_html', function($html, $product) {

    $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
    $price = $prices[0] !== $prices[1] ? sprintf( _x( '%1$s–%2$s', 'Price range: from-to', 'woocommerce' ), wc_price( $prices[0] ), wc_price( $prices[1] ) ) : wc_price( $prices[0] );

    return $price;

    return $html;
}, 10 ,2 );

thank you.

April 29, 2014 at 2:10 pm 19593
abelljefrry abelljefrry

Hello Nizam & Shaikat,

Thanks for your great response.

I’ve tried the code given above, it works great but it only remove the original price range (before discount) for variable products.

Can you provide me a code to remove the striked/dashed original price for simple products? I mean like this one:

View post on imgur.com

April 29, 2014 at 5:55 pm 19619
Sk Sk

Hello abelljefrry,

We have found the same 😛

Here the code for remove striked/dashed original price for simple products :

add_filter( 'woocommerce_sale_price_html', function($price, $product){

    $tax_display_mode      = get_option( 'woocommerce_tax_display_shop' );
    $display_price         = $tax_display_mode == 'incl' ? $product->get_price_including_tax() : $product->get_price_excluding_tax();

    $price = wc_price( $display_price ) . $product->get_price_suffix();
    
    return $price;

}, 10 ,2 );

put this code at the bottom of the previous one.

Thank you.

April 29, 2014 at 6:03 pm 19622
abelljefrry abelljefrry

Hello Shaikat,

It works! Thanks a lot! You guys are awesome! 🙂

Viewing 5 Posts - 1 through 5 (of 5 total)