Stock notification: Notify your customers when items are back in stock
Learn how to set up email notifications so your customers can be notified when out-of-stock products are restocked in your Shoporama online store.
Shoporama has a built-in feature that lets your customers sign up for out-of-stock notifications. When the item is back in stock, an email is automatically sent to all subscribers.
For this to work, you need two things in your theme:
- A sign-up form on your product page
- An email template called
in_stock_mail.html
All default themes (Delaware, DelawareDK, California, Alaska, etc.) have both from the start.
The signup form
If you build your own theme or want to customize the form, the basic structure looks like this:
<form action="" method="post"> <input type="hidden" name="out_of_stock_signup" value="1"/> <input type="hidden" name="product_id" value="<{$product->getProductId()}>"/> <input type="email" name="email" placeholder="Your email" required/> <label> <input type="checkbox" name="newsletter" value="1"/> Also subscribe to newsletter </label> <input type="submit" value="Notify me"/> </form>
The important fields are:
out_of_stock_signup- tells Shoporama that it is a stock signupproduct_id- the product IDemail- the customer's email addressnewsletter(optional) - subscribes to newsletter at the same time
Variants
If you use product variants and want to notify on a specific variant, include the attribute_value_id field with the variant ID. In the mail template, the variant will be available via the $variant_name variable.
The mail template
When a product is back in stock, Shoporama automatically sends an email based on the in_stock_mail.html template in your theme. The template has access to the $product object so you can display the product name, link and other details.
View subscribed customers
You can see who is signed up for stock notifications from the product overview in your admin panel.
Do you have any questions? Contact us at support@shoporama.dk.