• Resolved Sakib Hasan

    (@sakibhasan)


    Hi,

    • User added to cart a product
    • Used a coupon code into checkout and it’s worked
    • Removed product from cart and add to cart another variation of same product
    • And then when goes to checkout/cart page the the previous coupon code has not been applied, I want to keep applying the coupon code until the user remove/order is placed. It is possible somehow, even with custom code.

    Regrads

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Nadir Seghir a11n

    (@assassinateur)

    Are you using custom code to apply the coupon or is it being applied by the customer?

    Thread Starter Sakib Hasan

    (@sakibhasan)

    By the customer

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @sakibhasan

    Unfortunately, WooCommerce doesn’t have this feature by default. When a product is removed from the cart and it become empty, the associated coupon is also removed.

    However, this could be achieved with custom code. You need to create a function that applies the coupon code to the user session instead of the product/cart. This way, the coupon will remain applied until the user places an order or manually removes it.

    Please note that this requires advanced knowledge of PHP and WordPress development. If you’re not comfortable with this, you can seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @sakibhasan

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

    Thread Starter Sakib Hasan

    (@sakibhasan)

    Thanks! You can mark this as resolved

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.