In e-commerce website with WordPress WooCommerce plugin WooCommerce functionality showing the shipping method label on left hand side of the price on the Cart page, Thank you page ( Order Placed) and Order Email. if your clients dont like shipping method label and requested you to Remove Shipping Labels (Flat Rate) from Cart, Thank you and Order Email.
Following are few line code which you need to add in your active theme functions.php file
# For Remove Flat Rate Shipping Label on Cart Page add_filter( 'woocommerce_cart_shipping_method_full_label', 'wdo_remove_shipping_label_cart_page', 10, 2 ); function wdo_remove_shipping_label_cart_page($label, $method) { $shipping_label = preg_replace( '/^.+:/', '', $label ); return $shipping_label; }
# For Remove Flat Rate Shipping Label on Thank you ( Order Placed ) page and Email add_filter( 'woocommerce_order_shipping_to_display_shipped_via', 'wdo_remove_shipping_label_thnakyou_page_cart', 10, 2 ); function wdo_remove_shipping_label_thnakyou_page_cart($label, $method) { $shipping_label = ''; return $shipping_label; }
2 Comments. Leave new
Thank you 🙂
Thanks 🙂