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
[ekm:backinstock][/ekm:backinstock]
[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]
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.
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.
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.
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.
textbox_attribute='maxlength="1000"';
Specify any input
HTML attributes you would like to apply to the text fields. This will affect the email address.
button_attribute='';
Specify any input
HTML attributes you would like to apply to only the notify button.
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.
link_text_attribute='style="color: red;"';
Specify any tag attributes you would like to be applied to the link that appears when a familiar user (logged in or asked to be notified before) visits a page where the product is out of stock.
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.
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.
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.
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.
The EKM system allows for some tags to 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.
[ekm:backinstock]
on_submit='bisSubmitted';
[/ekm:backinstock]
email
), here you can perform validation.
<script type="text/javascript">
function bisSubmitted(email){
console.log('You submitted email: '+ email);
}
</script>
[ekm:backinstock]
on_success='bisSuccess';
[/ekm:backinstock]
<script type="text/javascript">
function bisSuccess(){
alert('You are signed up!');
}
</script>
[ekm:backinstock]
on_failure='bisFailed';
[/ekm:backinstock]
<script type="text/javascript">
function bisFailed(message){
alert(message);
}
</script>