Home › Forums › URL Coupons for WooCommerce › Can the coupon be used with a URL that also utilizes the add-to-cart parameter?
- Support forum for the URL Coupons for WooCommerce.
- This topic has 4 replies, 2 voices, and was last updated 2 years, 7 months ago by
Tom Anbinder.
- AuthorPosts
-
October 22, 2020 at 8:30 am #92545
Eugenio
ParticipantHi,
Is it possibile to concatenate url with coupon apply to the add product to cart?
Not sure about it: I’m trying but I didn’t succeded.
ThxOctober 22, 2020 at 3:04 pm #92546Hi Eugenio,
Generally, you should be able to do that with something like this:
http://example.com/cart/?add-to-cart=2495&alg_apply_coupon=test
Is it not working? If that’s the case – could you please post the exact URL you are trying it with? Also – are you adding simple products? Or variable products maybe?
October 22, 2020 at 3:40 pm #92547Eugenio
ParticipantHi, it is actually a simple product.
The URL I’m trying is as follow:
https://www.revoring.com/carrello/?add-to-cart=90498&cpn=offerta-homeI do not get what am I missing… 🙁
October 23, 2020 at 11:26 pm #92548Hi Eugenio,
Sorry for the late reply.
I did check it, and it looks weird indeed. Both params (i.e.
add-to-cart
andcpn
) work properly when used separately, however,add-to-cart
seems to be blockingcpn
for some reason when used together… Could I log in to your site to check what’s going on (my email is [email protected])? Please let me know if sharing an account is not an option, and I will continue solving it remotely.October 28, 2020 at 9:24 pm #92549If anyone else has a similar question – although I wasn’t able to reproduce the issue on my test server, after logging in to Eugenio’s site, I’ve managed to fix it. Generally, our “apply coupon” action was called later than “add to cart” action for some reason. I’m not sure why, as it’s working differently on my test server, but it may be some compatibility issue with some other plugin installed on the server. I ended up adding two new options to the plugin (in v1.3.1): Hook priority and Remove “add to cart” key. Both options are in the “Advanced” settings section of our plugin (in “WooCommerce > Settings > URL Coupons”). So now if you lower the “Hook priority” to 10, and disable the “Remove ‘add to cart’ key” checkbox, it all seems to be working fine.
- AuthorPosts
- You must be logged in to reply to this topic.