Opens the Side Cart panel.
The openSideCart()
function opens the Side Cart panel on the current page.
Notes:
openSideCart()
will work on mobile.function openSideCart(): Promise<void>;
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();
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.