Hi, I am trying to push a item to the cart through a repeater. when on desktop it works fine and adds all the items presented in the repeater, however on mobile it just goes straight to cart and doesn’t give it time to add all the tickets. the code is
if (wixWindow.formFactor === ‘Desktop’) {
const start = async () => {
await asyncForEach(tickets, async (t) => {
if (!added.includes(t._id)) {
await $w(‘#shoppingCartIcon1’).addToCart(GAME_ID, 1, {
“customTextFields”: [ {
“title”: “Cords”,
“value”: t.cords
}]
});
added.push(t._id);
deleteItem(t._id);
//console.log(t.cords)
}
});
wixLocation.to(“/cart-page”);
}
start();
} else {
const start = async () => {
asyncForEach(tickets, async (t) => {
if (!added.includes(t._id)) {
$w(‘#shoppingCartIcon1’).addToCart(GAME_ID, 1, {
“customTextFields”: [ {
“title”: “Cords”,
“value”: t.cords
}]
});
added.push(t._id);
deleteItem(t._id);
//console.log(t.cords)
}
});
wixLocation.to(“/cart-page”);
}
start();
}
Been trying to fix this for a few weeks, please help!
@customersupport
@freeingthegoodkidwit
@tom-phelps @helpidt
@wix