Repository Forums Support WooCommerce Extended Coupon Features PRO Coupons gets stuck when using add-to-cart endpoint

Topic Resolution: Resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #832
    John
    Participant

    Hi,

    When adding products to cart with the add-to-cart endpoint together with apply_coupon the coupon gets stuck to the apply_coupon so that it adds itself back when I add coupons by url.

    For example:
    1. Add a product (a bundle in this case) and use a coupon for free product linked to the added product:
    http://clearlygone.se/varukorg/?add-to-cart=3192&apply_coupon=c001
    2. Remove the bundle from the cart. This should theoretically remove the above coupon from cart.
    3. Add another free product to the cart using apply_coupon:
    http://clearlygone.se/varukorg/?apply_coupon=c002
    4. The expected behaviour now would be to have just the second free product in cart, but instead the bundle and first free product add themselves back to cart. The only way I can get rid of the first coupon is by clearing the browser cache.

    Thanks

    #836
    Soft79
    Keymaster

    Use this plugin:

    https://wordpress.org/plugins/soft79-cart-links-for-woocommerce/

    and replace add-to-cart with fill_cart

    #840
    John
    Participant

    That plugin throws fatal error.

    The reason is, it’s utilizing get_plugin_data() function which is fine, as long as it’s used in admin only, on frontend this is not available but you are also using it on frontend.

    #847
    John
    Participant

    My dev fixed your cart links plugin but the initial issue is still there with the extended coupon plugin when using fill_cart.

    Please advise how to solve this or refund my purchase.

    #848
    Soft79
    Keymaster

    Hi,

    you’re right about the get_plugin_data(), I will provide a fix soon. A Quick fix for now would be just replacing pluginVersion() with this:

    public function pluginVersion() {
      return '1.0.0';
    }

    It seems that currently you have the cart links plugin disabled. Could you please enable it so I can look at the issue?

    regards,

    Jos

    #853
    John
    Participant

    It’s not installed at the moment. It’s a production environment so I rather not mess with it too much. Please test it locally instead.

    Anyway, the cart links plugin isn’t the issue here. I purchased the extended coupon plugin and it seems to not work with add-to-cart so I can’t use it. I’m not really interested in workarounds as I need it to work with add-to-cart.

    I read another thread from someone using add-to-cart with the the extended coupon plugin and having issues too. Add-to-cart is commonly used so I really think your plugin should support it or state that it doesn’t support it.

    #854
    Soft79
    Keymaster

    I have it running on multiple production environments, so I know it works. The fix for the fatal error was released yesterday.

    Combination with add-to-cart has broken before after different WooCommerce releases; because they have changed the internal handling of add-to-cart. For now the most robust option is using fill_cart. fill_cart has another advantage; if the customer clicks the url for a second time; the products will not be added again.

    A fix for add-to-cart in combination with the most recent versions of WooCommerce will be released soon. I still must test it with the versions between 2.3.0 and 2.6.7 (and 2.7 beta).

    #954
    Soft79
    Keymaster

    Hello,

    The add-to-cart in combination with apply_coupon issue has been fixed in 2.3.7.4.

    regards,

    Jos

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