Offer
Import checkout previously initialized, and manipulate offers. As offers is a Map, it generates a unique id to easy manipulate offers, so each offer has uniqueId attribute.
Add offer#
import { checkout } from './lib'
checkout.offers = [ { id: 23, promotionId: 3, ...rest, },]// orcheckout.addOffer({ id: 23, promotionId: 3, ...rest,})Update offer#
checkout.updateOffer('uniqueId', { promotionId: 33,})Remove offer#
checkout.removeOffer('uniqueId')Add product to offer#
checkout.addProduct({ uniqueId: 'offer uniqueId', { id: 232, dtype: 'fiber', ...rest }})Update product to offer#
checkout.updateProduct(['uniqueId offer', 'uniqueId product'], { id: 22, dtype: 'insurance',})Remove product to offer#
checkout.removeProduct(['uniqueId offer', 'uniqueId product'])