For Example
If a custome buys 2 apples they would recieve a free banana
I found the code in Wix Refference:
wix-marketing-backend > coupons > CouponTypeBuyXGetY
import wixMarketing from ‘wix-marketing-backend’;
export function createCoupon() {
let couponData = {
“name”: “My Coupon”,
“code”: “myCouponCode”,
“startTime”: new Date(),
“scope”: {
“namespace”: “stores”
},
“buyXGetY”: { // Buy 2 items, get 1 free
“x”: 2,
“y”: 1
}
};
return wixMarketing.coupons.createCoupon(couponData);
}
// Returns promise that resolves to:
// bff1f257-5e7e-437d-9f86-098de337cae6
Can I write the code to have a specific product for “x”: 1 - then have a different specific product for “y”: 1 ?