I recently used code to apply quantity coupon discount for product, and its working properly. But when i wanted to use that coupon from predefined URL, and put into button, Coupon for some reason was not added to checkout page (i have disabled redirecting to cart after adding the product). This is the code that was provided before:
Progressive fixed Coupon Discount based on specific product quantity in Woocommerce
and this is URL that i linked to button:
https://siteurl.com/checkout1/?add-to-cart=319&coupon_code=gss30
where 319 is product ID (allready added into coupon restrictions) and gss30
is coupon code that i want to be added automatically to product. Can someone to help me, why coupon is not added automatically when i redirect to Checkout directly?
Some help?
EDIT: My answer bellow works just for logged in users. How to make working for all ?