1

I've been trying to remove the shipping completely from my woocommerce website. I was able to remove it only from the checkout page and the cart page BUT I want to remove also from the thank you page and from the emails that are being sent to customers after they purchase.

how can I do that?

thank you

0

1 Answer 1

0

There are two options

  1. you can do it with custom code.

For the shipping remove form thank you page you need to override the template.

This is all based on the thankyou.php of woocommerce. You need to delete the lines of code you do not wish to be shown and upload them to the following directory

wp-content/themes/your_child_theme/woocommerce/checkout/

To remove the shipping total line from email notifications please use the below filter.

add_filter( 'woocommerce_get_order_item_totals', 'filter__customize_email_order_line_totals', 1000, 3 );
function filter__customize_email_order_line_totals( $total_rows, $order, $tax_display ){
    // Only on emails notifications
    if( ! is_wc_endpoint_url() || ! is_admin() ) {
        // Remove shipping line from totals rows
        unset($total_rows['shipping']);
    }
    return $total_rows;
}

Please add code in the function.php file of your active theme.

  1. Simply you can change the settings from WooCommerce -> Settings -> General In the Shipping location please select Disable shipping and shipping calculation. Here I have shared the screens-shot for your reference:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.