Limit code use to specific products #90
-
Hey, I'm setting up a site where Gift Vouchers are primarily used in-person. As such we don't have redemption field in the checkout, instead we have a custom page where staff can redeem codes. This works great. However they have now also requested that vouchers can be used against some specific items in the shop. I'm thinking to hook into the This would allow a customer to use the voucher code in the coupon code field and allow me to setup usage rules. I guess I would then also need to hook into some commerce event to redeem the voucher if the coupon is redeemed. If I can figure out which event to use. Does this make sense? Is there a simpler way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Yep, at the moment there's no way to say "I only want vouchers to be redeemable on these products" (or the reverse), but it's something we might eventually build in. While vouchers are similar to discounts, we can't use the "Promotable" setting for products, like you can to disable certain products from having coupon codes and discounts applied to them. If I'm on the right track with your question? I'm not sure how you generate your codes, but if it's just about determining which products can have a voucher applied to them, there's the |
Beta Was this translation helpful? Give feedback.
Yep, at the moment there's no way to say "I only want vouchers to be redeemable on these products" (or the reverse), but it's something we might eventually build in. While vouchers are similar to discounts, we can't use the "Promotable" setting for products, like you can to disable certain products from having coupon codes and discounts applied to them.
If I'm on the right track with your question?
I'm not sure how you generate your codes, but if it's just about determining which products can have a voucher applied to them, there's the
EVENT_AFTER_VOUCHER_ADJUSTMENTS_CREATED
event where you can check against the product having a voucher applied to.