Search.../

getQuantity( )

Gets the quantity of a product on the Product Page.

Description

This function is currently only available for Wix Studio sites.

The getQuantity() function returns a Promise that is resolved when the product's quantity is retrieved.

Authorization

Request

This endpoint does not take any parameters

Response Object

Fulfilled - Product's quantity.

Returns an empty object.

Status/Error Codes

Was this helpful?

Get the product's quantity

Copy Code
1$w('#myProductPage').getQuantity()
2 .then((productQuantity) => {
3 let numberofBlueShirts = productQuantity; // 128
4 })
5 .catch((error) => {
6 console.error(error);
7 });