openSideCart( )


Opens the Side Cart panel.

The openSideCart() function opens the Side Cart panel on the current page.

Notes:

  • We are gradually replacing the existing Mini Cart with the new Side Cart panel.
  • This function will fail when viewing the site on mobile because there is no Mini Cart on the mobile site.
  • The new Side Cart works on mobile sites. When Side Cart functionality becomes available for your site, openSideCart() will work on mobile.
Method Declaration
Copy
function openSideCart(): Promise<void>;
Request
This method does not take any parameters
Open the Side Cart
JavaScript
import { createClient } from "@wix/sdk"; import { site } from "@wix/site"; import { ecom } from "@wix/site-ecom"; const wixClient = createClient({ host: site.host(), modules: { ecom }, }); document .getElementById("myOpenSideCartButton") .addEventListener("click", async () => { // on button click - open the side cart await wixClient.ecom.openSideCart(); });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?