Example Description
In this example, we display a low-in-stock message on the Stores Product page when the number of product items in stock falls below a specified number.
How We Built It
Page elements
On the Product page, we added a text element to display the low-in-stock message.
Code
Our site contains the following code:
On the Product page, when the page loads or when a site visitor navigates to a different product, do the following:
Get information about the current product.
If the product is in stock and the quantity in stock is 10 or less, show the low-in-stock notification.
Otherwise hide the notification.
Related Examples
Did this help?
|
Thanks for your feedback!
Custom Product Price
Let customers choose a price
Intermediate
Back in Stock Notification for Site Contacts
Allow site visitors to register and receive a notification when a product is back in stock
Advanced
Back in Stock Notification for Site Members
Allow site members to receive a notification when a product is back in stock
Advanced