Remove prices decline line error!

This topic contains 2 reply and 2 voices, and was last updated by mx 10 years, 5 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
May 21, 2014 at 4:27 pm 20790
mx Hi, In dokan/function.php, Add the following code, PHP tried many times but the error!Could you tell me how to solve this? Looking forward to reply! Thank you very much! Reference: http://wedevs.com/support/topic/how-to-remove-the-dashed-discount-price/
May 22, 2014 at 4:14 pm 20832
Sk Sk

Hello mx,

this function works fine in PHP version-5.3 and later. may be you are using lower version of php. you could update your php version.

or

don’t use the function in filter line. use like following


function discount_price_dash_remove($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;

}
add_filter( 'woocommerce_sale_price_html', 'discount_price_dash_remove', 10 ,2 );

this will work.

Thank you

May 23, 2014 at 7:47 am 20862
mx mx

Hello sk_shaikat,
Thank you!

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