Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Coupons gets stuck when using add-to-cart endpoint
- This topic has 7 replies, 2 voices, and was last updated 7 years, 3 months ago by Soft79.
-
AuthorPosts
-
November 15, 2016 at 10:27 am #832JohnParticipant
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
November 15, 2016 at 8:28 pm #836Soft79KeymasterUse this plugin:
https://wordpress.org/plugins/soft79-cart-links-for-woocommerce/
and replace add-to-cart with fill_cart
November 16, 2016 at 7:00 am #840JohnParticipantThat 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.
November 17, 2016 at 8:24 pm #847JohnParticipantMy 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.
November 17, 2016 at 8:52 pm #848Soft79KeymasterHi,
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
November 18, 2016 at 6:30 am #853JohnParticipantIt’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.
November 18, 2016 at 9:19 am #854Soft79KeymasterI 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).
December 18, 2016 at 5:07 pm #954Soft79KeymasterHello,
The add-to-cart in combination with apply_coupon issue has been fixed in 2.3.7.4.
regards,
Jos
-
AuthorPosts
- You must be logged in to reply to this topic.