php - Hide shipping label woocommerce -
I need to hide shipping label on my woocommerce cart page but keep it visible at checkout Page . I have read that I can use is_cart () to specifically target the car, but it has not worked with any code that I have written in the function php. How to complete this? -edit - I got the following code to put in the function. Php: add_filter ('woocommerce_cart_shipping_method_full_label', 'Remove_shipping_label', 10, 2); Now I need to combine the code "if (is_cart ())" to target the cart page, but I do not know how to The cart page is loaded by a template in the plugin folder: You need to copy the file into your theme for the overrides template: < You can now do anything with it (leave this blank too) and it only affects the cart page. Will do Checkout page uses a different template file to generate shipping fields. Source: Experience +
function remove_shipping_label ($ label, $ method) {$ $ new_label = preg_replace ('/^.+:/', '', $ label);
Return $ New_label;
}
woocommerce / templates / cart / cart-shipping.php
Comments
Post a Comment