This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs. See Stores Pagination for more information.
function queryProductVariants(
_id: string,
options: QueryProductVariantsOptions,
): Promise<QueryProductVariantsResponse>;
Requested product ID.
import { products } from "wix-stores.v2";
async function queryProductVariants(id, options) {
try {
const result = await products.queryProductVariants(id, options);
return result;
} 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.