Need help guys. My shoe store has only sizes as variants and I dont hold some sizes in my inventory. However, I want to offer my customers the opportunity to order any unavailable size on special order delivery of 30 to 40 days. How best can this be done on shopify trade theme? Do I need an app? I have enable continue selling if product is unvailable in the inventory, but this does not provide any special order delivery notice to customers. All help appreciated. Thanks guys.
Topic summary
A shoe store owner wants to allow customers to order out-of-stock shoe sizes with a 30-40 day special delivery notice on their Shopify store using the Trade theme.
Solution Provided:
- A custom code snippet was shared to display special order notices for unavailable variants
- Code should be added to
main-product.liquidfile in the Sections folder - The snippet checks inventory levels and displays a message when variants have zero stock
- “Continue selling when out of stock” must be enabled in product settings
Implementation Steps:
- Duplicate theme as backup
- Navigate to Online Store > Themes > Edit Code
- Locate variant selector block in
main-product.liquid - Insert provided code snippet before closing
</div>tag - Customize styling as needed
Additional Recommendations:
- Update order confirmation emails to mention special order delivery times (Settings > Notifications > Customer Notifications)
- Add messaging to shipping policy
- Consider using product attributes to display special order status through checkout
- Keep customers informed throughout their journey to prevent refund requests
Outcome:
The solution was successfully implemented and is working on all products except one featured product section on the homepage.
Hi @JustBC ,
Hope you’re doing terrific ![]()
I’ve put together a code snippet that you can add to your Shopify theme to display a special order notice when a variant is out of stock. This snippet checks if the variant’s inventory is being tracked and if the quantity is 0 (or less), then displays a message letting your customers know that the size is available on special order with a delivery time of 30 to 40 days.
Below is the code you can include in your product template file (for example, product-template.liquid):
{% comment %}
Loop through each variant and display a special order notice
if inventory is tracked and the available quantity is 0 or less.
{% endcomment %}
{% for variant in product.variants %}
<div class="variant-info">
<!-- Display variant title, price, etc. as needed -->
<h3>{{ variant.title }}</h3>
<p>Price: {{ variant.price | money }}</p>
{% if variant.inventory_management and variant.inventory_quantity <= 0 %}
<p class="special-order-notice" style="color: #d9534f; font-weight: bold;">
Special Order: This size is available on special order. Please allow 30 to 40 days for delivery.
</p>
{% endif %}
</div>
{% endfor %}
Steps:
-
Backup Your Theme:
Duplicate your current theme (Online Store > Themes > Actions > Duplicate) so you can easily revert if needed. -
Locate the Product Template:
Navigate to Online Store > Themes > Actions > Edit Code and find your product template file (commonly named product.liquid or within the /sections folder as product-template.liquid). -
Insert the Code:
Paste the above code snippet in the section where you loop through and display product variants. Adjust the placement if necessary to ensure the special order message appears where you’d like it. -
Customize the Styling:
You can remove the inline styles and use your theme’s CSS by targeting the .special-order-notice class to maintain your site’s design consistency. -
Test the Changes:
Save your changes and preview your product page to confirm that the special order notice appears for variants with zero inventory.
If you’d like any further customization or if you prefer not to deal with the coding yourself, just let us know – we’ll do it for you!
Best regards,
Shubham | Untechnickle
Awesome! I’ll try it first and get back to you if I run into trouble. One other thing. Do I enable or not the continue selling when out of stock in my product page?
Thank you.
Yes, you’ll have to enable “continue selling when out of stock” that way the shopper will be able to place the order. However, as we’re putting out the special delivery message they’ll be well informed about purchasing it ![]()
I had a look in the edit codes.
Under sections I find;
cart-notification-product.liquid,
featured-product.liquid and
main-product.liquid.
I did not find product.liquid or product-template.liquid
Where do I paste the snippets code?
There is also a file called Snippets. Could I add a new snippet by pasting code directly in snippets?
It has to be main-product.liquid.
- Find main-product.liquid in the Sections folder
- Locate the variant selector code block (usually contains variant-radios or variant-dropdown)
- Add this code just before the closing of the variant selection section:
{% for variant in product.variants %}
{% if variant.inventory_management and variant.inventory_quantity <= 0 %}
Special Order: This size is available on special order. Please allow 30 to 40 days for delivery.
{% endif %}
{% endfor %}
Hi,
I added the codes in main-product.liquid and tested it. It hasn’t worked yet. Not sure why it’s not showing special order notice on items out of stock.
Hey @JustBC .,
Would it be possible to share the collaborator code, because we’ll have to dig in and see what’s wrong. You can DM or email us the code, we’ll take care of the rest ![]()
Looking forward to hearing from you,
Shubham | Untechnickle
Please point me to the code number where I would find the variant selector block?
Hey @JustBC ,
Love the step by step Shubham has shared. We run a preorder & back in stock app so thought I’d chime in.
Besides dynamically showing a message for these out of stock variants on the product page, I’d also suggest setting clear customer expectations in their order confirmation emails and your marketing communications. (No need for an app to do this.)
You can just add a line of generic message to the order confirmation email and say something like “If items in your cart include special orders, these will ship in 30-40 days.”
To edit your order confirmation email, visit Settings > Notifications > Customer Notifications. Click “Edit code” and use the search function to find the sentence where it says “We’re getting your order ready to be shipped. We will notify you when it has been sent.”.
Typically we recommend merchant just to add the generic message after that sentence. Also to mention this in their Shipping Policy too. Super simple with no actual coding required!
Feel free to reply here if you have any questions about Shopify pre-orders and back in stock in general. There are a few of us here on this forum who are always happy to help!
Jo
@JustBC
You got some pretty good pointers from other folks here. Based on our experience running a preorder & back in stock alerts app too, it’s important to remind customers all the way through —i.e., from the product page to checkout and email notifications - that they’re placing a different type of order!
Many customers tend to forget that they placed a preorder, special order, backorder etc and they reach out asking for a refund or a cancellation. We see this with merchants who sold preorders without a flow that kept customers informed all the way through their journey. You can handle this to some extent by -
- Adding a message on the product page
- Setting up code to add product attributes that then appears in checkout
- Updating your email notifications to show those attributes in email notifications sent from Shopify.
It’s a bit of work, but it will save you effort in support conversations and refunds.
Most preorder apps do a great job of handling all of this for you, to the point where it’s just a few clicks!
Thank you very much Shubham!
It worked perfectly on all products, although I noticed it did not apply to one featured product sector, which I may have to remove from home page.
Otherwise, I’m glad to have this problem solved.
Cheers. Best wishes.
Charles
Thanks Jo!
Sure will take your advice!
Cheers.
Best wishes,
Charled
Got it!
Thanks chief.
Best wishes,
Charles