Gets the availability of relevant product variants based on the product ID and selections provided. See Use Cases for an example.
function getProductOptionsAvailability(
_id: string,
options: Record<string, string>,
): Promise<ProductOptionsAvailabilityResponse>;
Requested product ID.
Array containing the selected options. For example, ["color": "Blue", "size": "Large"]
.
import { products } from "@wix/stores";
async function getProductOptionsAvailability(id, options) {
const response = await products.getProductOptionsAvailability(id, options);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.