Opens the Quick View modal of a specified product.
The openQuickView()
function returns a Promise that is resolved
when the Quick View modal is opened.
The quantity input field in the Quick View will be pre-populated with 1, unless otherwise specified in the options.quantity
field.
If the product has different options or variants, they will be displayed for selection in the opened Quick View.
Note: This API will fail when viewing the site on mobile because there is no Quick View on the mobile site.
function openQuickView(
productId: string,
options: QuickViewOptions,
): Promise<void>;
ID of the product to be displayed in the Quick View.
Quick View options.
import { product } from "wix-stores-frontend";
// ...
$w("#myButton").onclick(() => {
const productId = "c329246b-d521-feb4-85f5-539ca992d73a";
product
.openQuickView(productId)
.then(() => {
console.log("Opening Quick View...");
})
.catch((error) => {
console.error(error);
// Handle the error
});
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.