Skip to main content

Restore previously used coupons

WooCommerce have made optimizations that now when the cart is empty, everything is reset. Meaning even coupons are removed, but only items removed are kept in session.

Why not coupons as well.

The idea is to cache the coupons used in session and any that are no longer used can be restored just like an item can. This feature is best with a UI to display them for customers once items are added to the cart again.

Status: In Progress1 comment

Log in to comment and vote

Comments1

  • CoCart Headless

    Team•

    Aug 6, 2025

    Note: This idea was based on what I understood of the code for the cart session if empty. I was wrong.

    After a brief test. While any items removed from the cart with a coupon, WooCommerce does hide the coupons applied but does not remove them. Coupons are still applied in session.

    Currently I do the same in not showing the coupons applied for an empty cart.

    In v5 the cart response has been improved and will have coupons show in the API even if the cart contents is empty.

    I guess I just need feedback on whether the API should show them by default or not even if cart is empty.

    Leave a comment below or upvote if you want them showing.