...
Setting the current state of items in the shopping cart –
setShoppingCartStore
. To transfer the current state of the shopping cart to the visualizer, call the methodCode Block window.wizartDK.setShoppingCartStore( language js const payload = [{vendor_code: 'vendor_code1', quantity: 1 }]; window.wizartDK.setShoppingCartStore(payload);
The method is available after opening the visualizer.
Getting the current state of items in the shopping cart –
getShoppingCartStore
. To get the items in the shopping cart, call thegetShoppingCartStore
method with a callback function. The callback function will receive the items in the shopping cart. The method is available after opening the visualizer.Code Block language js const callback = () => { console.log(payload); // [{vendor_code: 'vendor_code1', quantity: 1}, ...] } window.wizartDK.getShoppingCartStore(callback);
Удаление товара из корзины покупок –
onRemoveShoppingCartItem
. To get the goods when they are removed, you must call theonRemoveShoppingCartItem
method with a callback function. The method is available after opening the visualizer.Code Block language js const callback = () => { console.log(payload); // { vendor_code: 'vendor_code', removeAll: true } } window.wizartDK.onRemoveShoppingCartItem(callback);
Adding an item to the shopping cart –
onAddShoppigCartItem
. To add a product, you need to call theonAddShoppigCartItem
function with a parameter{ vendor_code: 'vendor_code' }
. The method is available after opening the visualizer.Code Block window.wizartDK.onAddShoppigCartItem({ vendor_code: 'vendor_code' });
...