A back in stock request form for Shopify product pages. While the selected variant is sold out, a bordered panel invites shoppers to leave their name and email; when the variant is in stock, the panel is hidden. Requests go through Shopify's own contact form, so they arrive in your store's contact inbox without an app. Copy section.liquid into your theme's sections folder and add it to your product template from the theme editor as "WDS Back in stock request".
How it works
The section renders a Shopify contact form with name and email fields, plus hidden fields for the request type, product title, variant title and a link to the variant. It follows the variant selected in your theme's product form: when a shopper picks a sold-out size or color, the panel appears and names that variant; when they pick one in stock, it hides again. It also reads the variant parameter in the address.
After a submit, Shopify reloads the page and the panel shows your success message, with focus moved to it. Errors, such as an invalid email, appear above the fields.
The copy is honest about what happens next: there is no automatic alert. You receive the request by email and write to the customer yourself when the item is back.
Customization
All of these are in the theme editor:
- Heading, Variant line, Text, Ask for a name, Name label, Email label, Button label and Note under the button.
- Success heading, Success text, Error heading and Request name in your email, which helps you filter these messages.
- Panel position (left, center or right) and Panel width.
- Background, Panel, Text, Accent (button) and Button text colors.
- Side padding, Top padding and Bottom padding.
Accessibility
The panel is a labelled region with an h2. Every field has a visible label, the email field is required and uses autocomplete="email", and errors are announced as an alert. The success message is a status message and receives focus after the page reloads. Inputs use a 16 px font size so phones do not zoom in, and all controls have a visible focus outline.
Usage notes
This section requires an Online Store 2.0 theme. Place it directly below your product information section; a theme section cannot sit inside the theme's own buy box, so the preview, which shows it under the buy button, is a simplification. Use Panel position to line it up with your product column. In the theme editor the panel is always shown so you can edit it.
The preview uses an invented product and only simulates the submit. Shopify may ask shoppers to complete a spam check before a contact form is sent. Variant changes are detected through the product form, change events and the address, which covers most themes; test it with a sold-out variant in yours. You need to keep track of the requests and email customers yourself.