getCurrentCart( )

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.

Migration Instructions

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:

  1. Add the new import statement:

  2. 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.

  3. 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.

Method Declaration
This method does not take any parameters
Return Type:Promise<Cart>
Was this helpful?