• Customer

    please check that why this is not working

    Post by: kushafaka Aug 11, 2017 at 07:52 (8 days 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

  • Supporter

    Post by: Kazim Vu, Aug 15, 2017 at 02:04 (4 days 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

We offer service for $29. If you would like to use it, please click here to provide your credential information.

CUSTOMIZED SERVICES

Use our expert service to turn your ideas into reality. Click here to provide your needed information.

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