I keep getting this error. I have referred to the forums and documentation on wix itself. But isn't any more info or maybe i am misreading the info. Although it would be great if anyone could help me figure out this!
FetchError: {"code":"CANNOT_ADD_CART","commandName":"AddToCart","message":"option Fabric for product with id 9b74bf6b-6288-66a3-e317-07f9d83e76ac is required","field":""}
So, I have added a regular button, changed its ID to #addToCardButton.
#pdtId is a hidden text box on page with the id of the product on DYNAMIC page
selectedOptions{}, is where I have stored my dynamic values, which I needed to be added to cart along with the product when the user selects it.
export function addToCartButton_click(event) {
//$w('#shoppingCartIcon1').addToCart(productId, 1, {choices: selectedOptions});
let d = $w('#pdtId').text;
$w('#shoppingCartIcon1').addToCart(d, 1, {"options": {choices: {"Fabric": "selectedOptions[1]","Button": selectedOptions[2], "Color": selectedOptions[3],"Zip": selectedOptions[4]}},})
.then( () => {
console.log("Product added");
} )
.catch( (error) => {
console.log(error);
} );
}
Overall, I am just trying to add certain customization options to products on my website which I wasn.t able to add through wix store, So I created dynamic page, linked everything but adding to cart isnt working, normal add to cart button (the one provided by wix) links to normal page's add to cart page and cannot be changed, also it needed to added product specific. And I guessed the first commented line only would be enough, it would be great if you can tell why it isnt.
Thanks in advance for anything that could be of help.
I am having the same issue on my site but after restarting my wix site, its start working fine.
Hi I am trying to implement add to cart button my website but getting FetchError. Can you please help me what is the issue? Thanks.
How can I integrate it in my new site? I want to migrate my website to wix. Please help me.
My friend please am sorry I couldn't get useful information for you.
Ok try it and let see okay
I think try restarting the wix site then try to get a vpn like tunnelbear free. I dont know if this works