Repository Forums Support WooCommerce Extended Coupon Features PRO Coupon by URL: How to "set-cart" and not "add-to"?

Topic Resolution: Resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3408
    dhickman
    Participant

    Hello,

    The “Coupon by URL” feature can add items to the cart. This is not exactly what we need. We would like to set the cart to hold an exact number of products, no matter how many times the visitor uses the link.

    Currently each request by the link adds a predefined number of product to the cart. If the visitor clicks the link twice, they will get double the amount in the cart, for example.

    This is problematic because the related coupon(s) has(have) min/max limitations, so when the visitor uses the link twice or more the applied coupons might get invalid.

    So it would be a lot less confusig to clear the cart first, and add the item(s) afterwards.

    It that possible somehow? Maybe programmatically?

    Thanks in advance.

    #3410
    Soft79
    Keymaster
    #3411
    dhickman
    Participant

    Thanks for the quick reply!

    I installed the plugin but it does not seem to solve the issue. Even though it works a bit differently than the “Coupon by URL” feature of “Extended Coupon Features PRO”.

    It does not clear the cart before filling it. For example:
    if I use this first:
    https://example.com/cart/?fill_cart=2x999&apply_coupon=2ormore
    then coupon “1productonly” is not accepted by this:
    https://example.com/cart/?fill_cart=1x999&apply_coupon=1productonly
    because I just get:
    The maximum quantity of matching products for this coupon is 1.
    This is because there are already two of those items in the cart.

    So the issue remains: how is it possible to have the plugin(s) empty the cart first?

    #3412
    Soft79
    Keymaster

    You can use set_cart= instead of fill_cart= to overwrite the cart.

    Beware that this potentially also causes confusion for the customer; if he had added items to the cart before clicking the url these items will be gone…

    #3413
    dhickman
    Participant

    Thank you, this is what we need and it works as expected!

    Because we have a one-product-only shop, only the number of that one-and-only item changes so this is the less confusing scenario in our case. Also, these are promotional links and visitors are likely not have even visited the site before but they might click on both links one after the other.

    #3414
    Soft79
    Keymaster

    Ok, great!

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