getCurrentCart( )


Deprecated. This function will continue to work, 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().

The wix-ecom-backend.CurrentCart.getCurrentCart() function works from both backend and frontend code.

To migrate to the new function:

  1. Add the new import statement:

    Copy
  2. Look for any code that uses cart.getCurrentCart(), and replace it with currentCart.getCurrentCart(). Update your code to work with the new currentCart.getCurrentCart() call and 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.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:Promise<CartObj>
Did this help?