• Customer

    please check that why this is not working

    Posted by: kushafaka Aug 11, 2017 at 07:52 (7 year ago)
    function cw_change_product_price_display( $price_html ) {
    global $product;
    global $woocommerce;
    if ( $product->is_on_sale() ) {
    return $price_html;
    }
    elseif($product->get_sale_price()){

    $price =wc_price($product->get_sale_price());
    return $price_html . $price;

    }
    else{
    return $price_html;
    }


    }
    add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );



    my this function is working porperly for simple products but not working on variable products will you tell me how to sort this

  • Customer

    Posted by: Kazim Vu, Aug 15, 2017 at 02:04 (7 year ago)

    Hi kushafaka
    My coders said you can refer these codes:
    function cw_change_product_price_display( $price_html ,$instance ) {
    global $product;
    global $woocommerce;
    if ( $product->is_on_sale() ) {
    return $price_html;
    }
    elseif($product->get_sale_price()){
    $price =wc_price($product>get_sale_price());
    return $price_html . $price;
    }
    else{
    return $price_html;
    }
    }
    add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display', 10, 2 );
    Regards,

INSTALLATION SERVICE

Theme Installation: $49. Pay now

CUSTOMIZED SERVICES

Use our expert service to turn your ideas into reality. Please send an email to kutethemes@gmail.com to provide the more detailed information. Thanks!

WORKING TIME

Our support service works from Monday to Friday.
Mean time (GMT +7):
+ 7:30 - 11:30 AM
+ 1:30 - 5:30 PM
We will try to answer all the questions within 24 hours and solve them as quickly as possible