Reputation: 11
Is it possible to hide WooCommerce available shipping options costs on cart page? I would like to display costs only on the checkout page.
On the screenshot below, the costs are underlined in red:
thank you
Upvotes: 1
Views: 103
Reputation: 253784
The follwing will remove shipping costs from shipping options in cart only:
add_filter( 'woocommerce_cart_shipping_method_full_label', 'filter_cart_shipping_method_full_label', 10, 2 );
function filter_cart_shipping_method_full_label( $label, $method ) {
// On cart remove costs
if( is_cart() ) {
return $method->get_label();
}
return $label;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and works.
Related: Change wc_cart_totals_shipping_method_label function in Woocommerce
Upvotes: 1