Big Wix-Stores Update!
We've added 6 new functions focused on working with the store cart using frontend code. These include showing and hiding the Mini Cart, applying and removing coupons, updating cart line item quantities, and adding products to the cart:
The new functions live in the new Cart subcategory. These APIs, along with those in the new Product subcategory, replace the existing frontend wix-stores functions, which have been updated with migration instructions. We’ll continue to support the existing functions, but we recommend migrating to keep your code compatible with future changes.
You can find migration instructions here:
getCurrentCart() - (migrated to Cart subcategory)
addCustomItemsToCart() - (migrated to Cart subcategory)
removeProductsFromCart() - (migrated to Cart subcategory)
onCartChanged() - (migrated to Cart subcategory)
getProductOptionsAvailability() - (migrated to Product subcategory)
getProductVariants() - (migrated to Product subcategory)
Do you plan on adding a clear() or removeProducts() function?
Right now I'm looping removeProduct() for the first product until the returned cart is empty, but it is slow and inefficient.