Deprecated.
This function will continue to work until September 4, 2024, but a newer version is available at
wix-ecom-backend.CurrentCart.getCurrentCart()
.
We recommend you migrate to the new Wix eCommerce APIs as soon as possible.
If this function is already in your code, it will continue to work.
To stay compatible with future changes, migrate to
wix-ecom-backend.CurrentCart.getCurrentCart()
.
To migrate to the new function:
Add the new import statement:
1
Look for any code that uses wixStoresBackend.getCurrentCart()
,
and replace it with currentCart.getCurrentCart()
.
Update your code to work with the new getCurrentCart()
response properties.
For more info about the differences between the Stores Cart and eCommerce Cart, refer to the cart conversion table.
Test your changes to make sure your code behaves as expected.
Gets the current site visitor's shopping cart.
The getCurrentCart()
function returns a Promise that resolves to the current
site visitor's shopping cart.
Note: When editing a site as a collaborator, getCurrentCart()
will only work when viewing the live site.