Speak to our experts today 0333 004 0333
Speak to one of our experts today
User Guides

EKM Tag: [ekm:backinstock]

This tag is used to output a form on the product page when an item is out of stock, here the customer can enter their email address and will be notified when the product is back in stock.

You must enabled Stock Control in settings. This tag can only be used on product pages

  • Tag Information
  • Nesting This Tag
  • Using Callbacks
Basic Use
In its basic use the tag will display the signup field where the user can signup to be notified when the product is back in stock.

[ekm:backinstock][/ekm:backinstock]
                                
This outputs the following.
Email me when this product is back in stock
Advanced Use
The advanced use allows you to specify any HTML or text you want to appear along side the form.

[ekm:backinstock]
    output_start='<div id="back-in-stock">';
    instock='';
    outstock='Email Me When Back In Stock';
    requestmade='You will be emailed when this product is back in stock';
    textbox_attribute='';
    button_attribute='';
    link_text_attribute='';
    output_end='</div>';
[/ekm:backinstock]
                                
Tag Attributes
Output Start
output_start='<div id="newsletter">';

Specify any HTML or Text you want to output before the field or message. This will only be output if the feature is enabled. Typically here you would output any opening HTML tags and headers.

Value
Description
{user defined}
Specify any custom HTML or text to output.
In Stock
instock='This Product Is In Stock';

Specify any text or HTML to be output if the product is in-stock. Typically this would be left blank.

Value
Description
{user defined}
Specify your own HTML and Text to be output.
Out Of Stock
outstock='This Product Is Out Of Stock, Email me when back in stock';

Specify any text or HTML to be output if the product is out of stock. This appears before the email field.

Value
Description
{user defined}
Specify your own HTML and Text to be output.
Request Made
requestmade='You will be notified when the product is back in stock';

Specify any text or HTML you would like to appear when the user has submitted their email address. The form will be removed at this point.

Value
Description
{user defined}
Specify your own HTML and Text to be output.
Text Field Attributes
textbox_attribute='maxlength="1000"';

Specify any input HTML attributes you would like to apply to the text fields. This will affect the email address.

Value
Description
{user defined}
Specify any HTML attributes to output
Button Attributes
button_attribute='';

Specify any input HTML attributes you would like to apply to only the notify button.

Value
Description
{user defined}
Specify any HTML attributes to output on this button.
Button Image
button_image='/ekmps/shops/mytestshop/resources/Design/signup-button.png';

Specify a path to any image you wish to use as the button. Remove this attribute if you would like it to be a normal submit button.

Value
Description
{user defined}
Specify any image path.
Output End
output_end='</div>';

Specify any HTML or Text you would like to output when the form or message has finished outputting. Typically here you would close any opened divs from the output_start attribute.

Value
Description
{user defined}
Specify any HTML or Text to be output.
Callback: Submit
on_submit='functionName';

These are for advanced use only, see Callback documentation for further information.

Specify the name of a Javascript function with global scope to be called when the user submits their email address.

Value
Description
{user defined}
Specify the name of any javascript function.
Callback: Success
on_success='functionName';

These are for advanced use only, see Callback documentation for further information.

Specify the name of a Javascript function with global scope to be called when the user submits their email and receives success.

Value
Description
{user defined}
Specify the name of any javascript function.
Callback: Failure
on_failure='functionName';

These are for advanced use only, see Callback documentation for further information.

Specify the name of a Javascript function with global scope to be called when the user submits their email address and receives a failure.

Value
Description
{user defined}
Specify the name of any javascript function.

The EKM system allows for some tags to be nested within other tags.

This tag cannot be nested within other tags

This section offers documentation on the custom javascript callback responses offered by the backinstock tag. If you do not have a working knowledge of Javascript or Callbacks avoid using these features as it could cause errors and user problems for your site.

Submit Callback
As documented in the attributes, this attribute is used to call a javascript function when the submit button is pressed.

[ekm:backinstock]
    on_submit='bisSubmitted';
[/ekm:backinstock]
                                
This function is passed the email address as a parameter (email), here you can perform validation.

<script type="text/javascript">
function bisSubmitted(email){
    console.log('You submitted email: '+ email);
}
</script>
                                
Success Callback
This function is called when the user is successfully signed up.

[ekm:backinstock]
    on_success='bisSuccess';
[/ekm:backinstock]
                                
With a success message the function is called with no parameters.

<script type="text/javascript">
function bisSuccess(){
    alert('You are signed up!');
}
</script>
                                
Failure Callback
This function is called when the user signup has failed.

[ekm:backinstock]
    on_failure='bisFailed';
[/ekm:backinstock]
                                
When this function is called a message parameter is passed with information about the error.

<script type="text/javascript">
function bisFailed(message){
    alert(message);
}
</script>