• Resolved loopforever

    (@loopforever)


    Hello, I am adding these two codes inside the child theme. However it doesn’t work. Is there any other alternative?

    Link-StackOver

    add_filter( 'woocommerce_cart_shipping_method_full_label', 'add_free_shipping_label', 10, 2 );
    function add_free_shipping_label( $label, $method ) {
        if ( $method->cost == 0 ) {
            $label = 'Free shipping'; //not quite elegant hard coded string
        }
        return $label;
    }
    add_filter( 'woocommerce_order_shipping_to_display', 'add_free_shipping_label_email', 10, 2 );
    function add_free_shipping_label_email( $label, $method ) {
        if ( $method->cost == 0 ) {
            $label = 'Free shipping'; //not quite elegant hard coded string
        }
        return $label;
    }

    I enabled a flate price for a region. I created three different classes. The delivery fee in one of these classes is 0. If the delivery fee is 0, when the customer purchases the product, on the Order Details page:
    It says “Subtotal: Flat Rate”.
    I want to make this “Free Shipping”. Is there a way?
    two code above shows “Free Shipping” if there is a shipping fee. So,
    “Sub Total: Free Shipping”.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sub Total’ is closed to new replies.