Is there a “REMOVE FROM CART” api that can be used as the opposite function of addToCart() within WIX STORES.
“KeepButton” in repeater adds to cart (code figured out)
“RemoveButton” is not connected and I cannot find an API that will allow me to remove
Another option is when the mini cart opens - is there an API i can use to capture the remove item “x” so that I can create an “if function” around clicking this button to remove the product ID.
@stevesoftwareservice @sapirh @corvidcode @cacrites2007 @liran-kurtz-wix @brett-haralson
Would any of you be able to help with a “REMOVE FROM CART” api in corvid?
Hi there! I am not a Corvid expert by any means
let’s see if anyone can jump in. 
@tarrahopwood Hey Tarra, I don’t have a site using stores in that way to test it, but what happens if you pass a -1 into the quanity parameter here?
$w('#myShoppingCartIcon').addToCart("ea77f230-558f-0ba565e8f827", -1)
@christopher-derrell Thanks for this idea - however it doesn’t appear to trigger any event. See code below for “ADD” and “REMOVE”
// Set the action that occurs when a user clicks the "Add to Cart" button for the current item.
$w('#cartButton').onClick(() => {
// Get the current product's object from the global products object.
let productObj = productsMap[product.productId];
// Add the current product to the shopping cart with the selected color.
$w("#shoppingCartIcon").addToCart(productObj.productId, 1)
.then(() => console.log('added!'))
$w('#cartButton').disable()
.catch(console.error);
});
// Set the action that occurs when a user clicks the "REMOVE FROM CART" button for the current item.
$w('#removeButton').onClick(() => {
// Get the current product's object from the global products object.
let productObj = productsMap[product.productId];
// Add the current product to the shopping cart with the selected color.
$w("#shoppingCartIcon").addToCart(productObj.productId, -1)
.then(() => console.log('removed!'))
$w('#cartButton').disable()
.catch(console.error);
});
@tarrahopwood Hey, you didn’t set up the catch correctly from what I’m seeing. The line with
$w('#cartButton').disable()
is blocking the catch code.
I’m interested in seeing what the error is for removeButton
@christopher-derrell Thanks for seeing that! See error below
FetchError: {"code":"ERROR_INVALID_COMMAND_FIELD","commandName":"AddCartItemCommand","message":"got -1, expected more than 0","field":"quantity with value \"-1\" got -1, expected more than 0"}
The removeProductFromCart API is now available.