clearEcommerceCart

❗️

Deprecated

This method is no longer recommended.

The clearEcommerceCart() method removes all items added to the cart.

Syntax

clearEcommerceCart()
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void

Examples

To remove all items from the cart:

_paq.push(["clearEcommerceCart"]);
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void
clearEcommerceCart(): void

Notes

  • The cart with cleared items is not stored in the browser storage. Make sure that you add or clear all items again after the page reloads.
  • This method doesn’t send any data to Piwik PRO. It just updates the cart. You can use the trackEcommerceCartUpdate() or trackEcommerceOrder() method to send cart data to Piwik PRO.

Related methods