I want to add an item to the cart (that same item gets discounted with the coupon) upon using a coupon code (with a hook).
E.g. when using the coupon code SAMPLECODE, a product is added to the cart with a $2 discount. The coupon is set up to apply a $2 discount for that product only.
The problem is, that my coupon code only applies to the item that is going to be added programmatically, so it fails the eligibility check and doesn’t get to woocommerce_applied_coupon
.
So is there a hook that fires before checking if the coupon is valid?
Or should I just do it via javascript when applying a coupon? Is there a way to do it via AJAX?
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com