I have one little problem that dont know how to fix myself. I want to use this logic into my Woocommerce store just for one product.
I have use link like this to autmatically apply coupon code and add to cart:
https://testsite.com/checkout/?add-to-cart=Product_ID&quantity=1&coupon=Coupon_Code
and this seems to work, when quantity is 1. But i want discount (30%) that is automatically placed when click on direct link from before, to make dynamic, for ex:
- Increase quantity to 2 in cart page, and coupon automatically to calculate
2 x 30$ = 60$
discount, - buy 3 from same product, and calculate
3 X 30$ = 90$
coupon discount and so on..
I searched, and found this usefull thread, but there situation is little different then mine.
How can I make to have a specific coupon? Some advice or start point. Thanks
This is possible with that 2 steps:
1) Add a unique coupon with:
30
2) Add this code (where you will set your coupon code in the function (in lowercase)):
Code goes in function.php file of your active child theme (or active theme). Tested and works.