Comercia Studio Paid Cart Cleaner for WooCommerce

Description

WooCommerce empties the cart only when the customer reaches the “order received” page. But many payments happen somewhere else: on the bank’s page, in a banking app (Bizum), or in a wallet (Apple Pay, Google Pay). If the customer pays and never comes back to your shop, their cart stays full. The next time they visit, they see the same products again and may think the payment failed, or buy them twice. With the Cart and Checkout blocks, WooCommerce does not empty it on the next visit either.

Even when the customer does come back, other requests fired by that same page (for example, admin-ajax calls from other plugins) can read the old cart and save it again after it was emptied.

Comercia Studio Paid Cart Cleaner fixes both cases:

  • When an order placed by the customer is paid, it remembers which products and coupons were in it.
  • The first time that customer’s cart is loaded after the payment, on any page and in any request, those products and coupons are removed.
  • Anything the customer adds after paying stays in the cart: a product they forgot, yes; repeating the whole order by accident, no.
  • It works for logged-in customers and for guests.
  • It ignores renewals, manual orders and anything not placed by the customer at the checkout.

There are no settings. Activate it and it works.

This plugin was built and tested on our own WooCommerce stores in Spain and Portugal, where customers pay with Bizum, Apple Pay, Google Pay, cards and PayPal.

This plugin is developed by Comercia Studio. It is not affiliated with, endorsed by or sponsored by WooCommerce or Automattic. WooCommerce is a registered trademark of Automattic Inc.

For developers

  • paidcc_keep_coupons (array $codes, WC_Order $order): coupon codes that must stay in the cart, for example a loyalty points coupon managed by another plugin.
  • paidcc_remove_cart_item (bool $remove, array $cart_item, array $paid): whether a cart line is removed. Return true for lines another plugin adds by itself (a free gift, for example) so they are recalculated.

FAQ

Does it work with the Cart and Checkout blocks?

Yes, and with the classic shortcode checkout. It also declares compatibility with High-Performance Order Storage (HPOS).

Will it remove products the customer adds after paying?

No. It cleans the cart once per payment. What the customer adds afterwards stays.

Does it touch subscription renewals or orders created in the admin?

No. Only orders placed by the customer at the checkout (classic or blocks).

What does it store?

For logged-in customers, a small user meta with the last paid order (time, product IDs and coupons). For guests, a transient that expires after 3 days. Uninstalling the plugin deletes the user meta.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Comercia Studio Paid Cart Cleaner for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • First public release.