Prints a form that enables the customer to subscribe to availability notifications sent once the product is back in stock.
Kuvaus
You can define when the form should be displayed to customers by using the tag's display attribute. You can display the form e.g. only if the product is out of stock.
For more information about availability notifications, see our user guide.
Syntaksi
{AvailabilityNotificationForm( display: string, order_newsletter: boolean, success: string, failed: string )}Näkyvyys
Toimii näkyvyydessä: tuote
Implementing availability notifications in a theme
Add a subscription form for availability notifications to the product page using the {AvailabilityNotificationForm} tag. You can define a customized introductory text to the form in the tag's before attribute.
{AvailabilityNotificationForm( before: ' <h2>{%AvailabilityNotificationIntroTitle}</h2> <p>{%AvailabilityNotificationIntroText}</p> ', display: 'outofstock', order_newsletter: true )}The example shows how to display the form only when the product is out of stock by using the display attribute. To add the newsletter subscription form to the form, use the attribute.order_newsletter:true
Apart from the availability notifications subscription form, your theme needs to contain the email template /emails/product/back-in-stock.html, which is used to format the availability notification messages.
You can use product tags in this template. The email subject and content are printed with the tags {EmailTitle} and {EmailMessage}.
Attribuutit
display:Defines conditions under which the form is displayed to customers.
Allowed values:
- 'unavailable': the product is out of stock and its stock information says that the sales should be stopped if the product is out of stock (default value)
- 'out_of_stock': the product is out of stock but the product still can be purchased
- 'backordered': the product can be pre-ordered (see also How do I create a pre-order product?)
- 'always': the form is displayed in any case
order_newsletter:The value true adds also the newsletter subscription option to the form.
Allowed values: true/false. Default value: true.
success:The message that is displayed after the form has been sent successfully.
By default, the entry 'AvailabilityNotificationFormSuccess' is displayed from the online store's dictionary.
failed:The message that is displayed after the form couldn't be sent.
By default, the entry 'AvailabilityNotificationFormFailed' is displayed from the online store's dictionary.
before/after:With the
beforeandafterattributes, you can define content that is output before or after the content produced by the tag.Allowed values: text that may contain HTML and Interface markup.
E.g.
before:'<p>This markup appears before the tag's own content.</p>'.after:'<p>This appears after the tag's own content.</p>'
If the tag does not produce any content, the content of the
beforeandafterattributes will also not be displayed.escape:Adds an escape character before quotation marks in the output. The attribute makes it easier to process the tag-produced content when using JavaScript.
Allowed values: true/false. The default value is false.
or:Defines alternative content that is displayed if the tag itself does not produce any content.
Allowed values: text that may contain HTML and Interface markup.
E.g.
or:'Content not found.'
