• 0

How to clear cart item with a custom url in WooCommerce?

  • 0

Can I create a custom url to clear cart item by simply running the url? Is this feature availble by default in woocommerce?

1 Answer

  1. By default WooCommerce is not providing a URL to remove items in cart. If you want to create a custom URL for clear cart try this code in functions.php

    add_action('init', 'woocommerce_clear_cart');
    function woocommerce_clear_cart() {
        if(isset($_GET['clear-cart'])) {
            global $woocommerce;

    This will allow you to remove cart item by running this URL

Leave an answer

You must login to add an answer.