Repository Forums Support WooCommerce Extended Coupon Features PRO Coupon by URL not working with empty cart

Topic Resolution: Resolved
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #18083
    Christophe Paganon
    Participant

    Hi,

    We have a specific landing page which redirects to a shop page through a button which is supposed to apply the coupon automatically. However it stopped working a few weeks ago it seems.

    Here is the landing page: https://panierquebecois.ca/bio/
    The buttons on this page redirect to the shop page with this link to apply the coupon: https://panierquebecois.ca/produits-bio/?apply_coupon=decouverte_bio

    However, if the cart is empty (which it always is since you are coming from a landing page), the coupon never applies. We have checked this option : “Allow applying when invalid”. But even after we add products, the coupon never applies.

    If we add products to cart, then go back to the landing page (https://panierquebecois.ca/bio/) and clic on the button, then we are redirected to the shop page and the coupon is applied.

    Are we doing something wrong?

    Thank you,

    #18084
    Christophe Paganon
    Participant

    Update: I made a fresh copy of the website into our staging environment here: https://woocommerce-573730-2040369.cloudwaysapps.com/

    Everything is working on the staging environment but not in production.

    All the settings, files, folders and database are the exact same. And I can’t even test fixes since it just works on the staging environment.

    #18085
    Christophe Paganon
    Participant

    Update again, I found the culprit: varnish cache on the server level was causing the issue. I excluded the pages from being cached and it solved the problem.

    However, it used to work with varnish enabled, was something changed in the latest updates? Any solution to have the URL feature work with varnish enabled?

    #18087
    Soft79
    Keymaster

    Not familiar with Varnish cache, but is it possible to disable cache for urls with the apply_coupon query parameter?

    #18090
    Christophe Paganon
    Participant

    I don’t have that option with my server unfortunately. Only excluding URLs or cookies.

    #18091
    Soft79
    Keymaster

    In that case maybe you should disable cache for https://panierquebecois.ca/produits-bio/ .

    #18101
    Christophe Paganon
    Participant

    That’s what I did. But I was hoping there would be a more permanent option that could work with our varnish cache enabled.

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