getProductOptionsAvailability( )


Gets the availability of a product based on the specified option choices.

The getProductOptionsAvailability() function returns a Promise that is resolved to a ProductOptionsAvailability object when the product's availability information is retrieved.

The information returned in the selectedVariant and availableForPurchase properties reflects the option choices passed in using the ProductChoices parameter.

If the specified choices result in the selection of a single product variant, that variant is returned in the selectedVariant property and the availableForPurchase property indicates whether that product variant is available for purchase.

If the specified choices do not result in the selection of a single product variant, no variant is returned in the selectedVariant property and the availableForPurchase property will be false.

Method Declaration
Copy
Method Parameters
productIdstringRequired

The ID of the product whose availability is being checked.


choicesProductChoicesRequired

Option choices to use when checking the product's availability.

Returns
Return Type:Promise<ProductOptionsAvailability>
Was this helpful?
Yes
No