If a product or product option / variation is out of stock, this displays a message and button on the product page which allows buyers to sign up to receive an alert when a product comes back into stock. Alternatively, if the system settings allow backorders to be taken, then they may also wish to place a backorder and still sign up for alerts.


Additionally, a back-in-stock ETA date can also be displayed if it has been set on the product or option / variation which triggers a separate email saying when the ETA date has changed. 


Displaying Stock / ETA Messages To Specific Customer Groups
You can adjust the product page template so that these messages only show to certain customer groups, for example you might wish to only show messages to distributors whereas retail customers wouldn't see it so you always capture their orders whether in stock or not. The Buy Now / Place Order button text could also be replaced to 'Place Backorder' for the required customer groups.


Notes: 

  1. This does not sign the person up to your newsletter, it is purely a stock notification so they can return to buy the product
  2. Template changes are required for this functionality.


Setting The ETA Dates

You set the Back in stock date via Edit product & display it on the web product page via the product_info.html.twig template {{dump(product.back_in_stock_date) }}.


Edit Product > Stock tab > Product level stock date:

Product Page > Stock tab > Variation level stock date:


Viewing All ETA Dates
Admins can view the Back in Stock ETAs in Reports > Back in Stock Dates to see what products are meant to be arriving soon & update them if the dates have slipped. Administrators will receive alerts when the back in stock date is approaching to check that stock will arrive on time. 


Timing of Alerts

The system automatically checks for new stock every hour and emails people who have signed up for the alert when there is stock back in. Once the email has been sent they will no longer receive further back in stock alerts for this stock item.


Sending Alerts To All Customers Who Have Purchased - Whether Signed Up To Alerts Or Not

You can send Back in Stock and ETA date change alerts to all customers who have made an actual purchase (i.e. placed a backorder) even if they have not signed up to receive alerts, send a request to support turn on the superadmin feature: Enable Backorder Purchase Stock Alerts


Set Up

To set this up:

  • Via the template files: product_back_in_stock_notification & product_back_in_stock_date_notification
    You can view these in Email Tasks > scroll down to System emails 

  • Via Form Builder, you have a form set up called "Back In Stock Alert", modify the default text if necessary and also in the product_info.tpl template shown below.


NB If your store was set up prior to 24th December 2014, you will need to add in the following code to your active product template > Store > product_info.tpl:


Replace the current  "is_out_of_stock" section (on or around line 78 just below the "product_price" line) with the following:


 

{# is the product out of stock? #}
{% if product.is_out_of_stock %} <br /><br /><span class="out_of_stock"><em>Sorry, currently not in stock!</em></span><br /> <a id="toggle-stock-alert-form" class="generated_button">Notify me when back in stock</a>{% endif %}

 


And at the footer/bottom of the template paste in:


  

{# Alert when back in stock #}
{% if product.is_out_of_stock %}

<style>
#toggle-stock-alert-form { cursor: pointer; }
#rec-form-p49ch4jB6q3W1ei6UL46 { width: 370px; height: 150px; }
</style>

<script type="text/template" id="rec-product-back-in-stock-container">

<form action="/pages/formbuild_processor.php?key=p49ch4jB6q3W1ei6UL46" class="rec-form rec-form-dm-small" id="rec-form-p49ch4jB6q3W1ei6UL46" enctype="multipart/form-data" method="post" data-ajax-enabled="1" data-ajax-success-text="Thanks%2C+we+will+alert+you+as+soon+as+this+item+is+back+in+stock%21">

<input type="hidden" name="input_field_BCoO4D4uS7eq8TUR9qJh" id="input_field_BCoO4D4uS7eq8TUR9qJh" value="{{ product.id }}">
<h3>Notify me when back in stock</h3>
<p>We can alert you as soon as this item is back in stock.</p>
<p>
<label for="input_field_fNhocQKQ2H8nyG3R9RBX">Email address: </label>
<input type="email" name="input_field_fNhocQKQ2H8nyG3R9RBX" id="input_field_fNhocQKQ2H8nyG3R9RBX" placeholder="" required class="rec-form-field rec-generic-field rec-form-field-med"><span class="rec-form-required-marker">*</span>
</p>
<input type="submit" value="Subscribe" class="rec-form-button">

<!-- spam honeypot hybrid -->
<p id="rec_honeypot_hybrid_817"><label for="honeypot_hybrid_answer_817">To prove you're not a robot, whats 4 plus 5?</label><br><input type="text" name="honeypot_hybrid_answer" id="honeypot_hybrid_answer_817" value=""></p>

</form>

</script>

<script>
(function($){

// popup stock alert form
$('#toggle-stock-alert-form').on('click', function () {

// open modal
$.fancybox( $('#rec-product-back-in-stock-container').html() );

// honeypot hybrid js
$("#honeypot_hybrid_answer_817").val("9");
$("#rec_honeypot_hybrid_817").css("display","none");

// on submit
REC.Events.subscribe('form.form-submit-finish', function () {
$('#fancybox-wrap').css('height', '230px');
$('#fancybox-inner').css('height', '210px');
$.fancybox.center();
});

});

})(jQuery);
</script>

{% endif %}