Support » Plugin: WooCommerce » Remove zeros after custom shipping classes

  • Resolved ngrudev

    (@ngrudev)


    HEllo,

    After WC release 3.4 there is a “Tweak ā€“ Display zero value when using shipping classes. #18624” wich add zeros (0.00) after custom shipping classes.

    This misleads the customers and they think the shipping is free. Unfortinately there is no option to disable the zeros, and my question is how to do it with some custom php code which to add in my functions.php

    10x

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK

    (@riaanknoetze)

    This is a fairly complex development topic. Iā€™m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:
    * WooCommerce Slack Community: https://woocommerce.com/community-slack/
    * Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    I fixed it using this code:

    
    add_filter( 'woocommerce_order_amount_shipping_total', 'shipping_total_convert_zero_to_int' );
    function shipping_total_convert_zero_to_int( $value ) {
        if($value === '0.00') {
            $value = 0;
        }
        
        return $value;
    }
    
    add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_local_pickup_free_label', 10, 2 );
    function remove_local_pickup_free_label($full_label, $method){
        return $method->label;
    }
    

    It removes the cost from the checkout page, order-received page and e-mails.

    awesome, thanks šŸ™‚

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove zeros after custom shipping classes’ is closed to new replies.