admin管理员组

文章数量:1122832

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

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

Share Improve this question asked Nov 15, 2019 at 6:04 W.MW.M 112 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 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:

本文标签: customizationhow do I remove the shipping from woocommerce thankyou page and from the email