Skip to content
Advertisement

Remove applied specific fee from Cart programmatically

I have applied a specific fee to my WooCommerce cart in the following way:

JavaScript

What the above code does is that in addition to the Subtotal and Shipping charges, it adds the Delivery Fee to the total and shows the grand total correctly.

I want to now remove the applied fees programmatically, but I am unable to do so.

I tried this, but it does NOT work:

JavaScript

Here is my complete code:

JavaScript

How can I remove the applied fees programmatically without having to clear the cart?

Advertisement

Answer

Depends on how you need this be, here’s one solution:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement