Support » Plugin: WooCommerce » Coupon failed on checkout after upgrading to WC 4.0.0

  • Resolved rollybueno


    Hi there,

    After upgrading to WC 4.0.0, we can’t use the coupon on checkout anymore. See –

    This is the current coupon –

    As you can see, the expiration is next year and it’s no been used. I’ve traced it on core files and the issue seems coming from check_and_hold_coupon() which is new on WC v.4.0.0

    Reverting back to WC 3.8.1 has no issue and same coupon can be used without problem.


Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Peter Fabian


    Hi @rollybueno , in WC 3.9, we’ve added protection against a possible attack on the shops where a customer could use a coupon multiple times even if it was limited to 1 per user, if the order was submitted exactly at the same time. The ‘hold’ time for the coupons since WC 3.9 is the same as for products–60 minutes by default.

    I can see your coupon has total limit of usages of 1, so I would guess there might be someone else trying to use the coupon around the same time maybe? Can you reproduce the same issue with only WooCommerce installed (other plugins being disabled) and a new coupon? Thanks!

    • This reply was modified 1 year, 8 months ago by Peter Fabian.

    I have the same problem, and the coupon has not been used at all before, as I tested a coupon for the abandoned cart which is personal.
    How do we solve this issue?

    Me too. Please help us because this is a big big problem. The only workaround is to remove the usage limit of the coupon, make the order and then put again the limit. But this is not the solution. 90% of our customers use coupons and this is a nightmare at the moment.

    The problem started when I updated few days ago to WC 4.

    I have urgent need to solve the issue with the coupon.
    I have affiliates that promotes coupons and coupon for abandoned cart and can’t be limited in time.
    I need this solved urgently
    The site is

    Plugin Author Peter Fabian



    Apologies for the trouble. We think this might happen for some coupons that are missing usage count information. We’re going to release a fix in 4.0.1 for this soon. Hope it helps.

    Plugin Support wbrubaker.a11n


    4.0.1 has been released. Has that update fixed this problem for you?

    unfortunately I can’t update woocommerce, as the site breaks the moment i update even the version 4.0.1.
    So I can’t tell you if the update solves it

    Plugin Support wbrubaker.a11n


    What steps have you taken to resolve that?

    I actually have no idea of what to do to solve it other then wait for the next version.
    Can you advise me on what I could do?

    Plugin Support wbrubaker.a11n


    I can think of a couple of things.

    It’s unclear what you might mean by “site breaks” but it makes me think that there are probably PHP fatal errors. Examining the error logs may provide clues. WooCommerce does attempt to log fatal errors and if it is able to, they would be logged in WooCommerce -> Settings -> Logs – near the top left you will see a dropdown selector. The naming convention of the log files should be self-explanatory. Select the appropriate log, press view.

    Another option would be to test the behavior under conflict troubleshooting conditions. Switch to an unmodified, default WordPress theme such as Twenty Twenty and deactivate all plugins. Update WooCommerce then activate WooCommerce. What happens?

    thank you for the answer.
    I’ve deactivated all the plugins and updated woocommerce, then reactivated one by one and found the culprit and delate it.
    Thank you.
    For the coupon I’ll check how it goes.

    Plugin Support EtienneP a11n


    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Coupon failed on checkout after upgrading to WC 4.0.0’ is closed to new replies.