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);
function remove_shipping_label ($ label, $ method) {$ $ new_label = preg_replace ('/^.+:/', '', $ label);
Return $ New_label;
}

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

  woocommerce / templates / cart / cart-shipping.php   

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 +

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -