Shopify themes, liquid, logos, and UX
If you have products that are out of stock, you can sell them as pre-orders. This is done by creating an alternate product template, and editing your payment settings. You can also use this customization to continue selling products that are on back-order.
Note: This customization isn't compatible with dynamic checkout buttons. If your theme supports dynamic checkout, then prevent the buttons from showing by following the steps to hide dynamic checkout buttons on product pages.
Sectioned and non-sectioned themes
The steps for this tutorial differ depending on whether you are using a sectioned or a non-sectioned theme. A sectioned theme is a newer theme that lets you drag and drop to arrange the layout of your store's pages.
To figure out whether your theme supports sections, go to the theme's Edit code page. If there are files in the Sections directory, you are using a sectioned theme. Non-sectioned themes were released before October 2016, and do not have files in the Sections directory.
If you are using a sectioned theme, then click the Sectioned themes button and follow the instructions. If you are using an older, non-sectioned theme, then click the Non-sectioned themes button and follow the instructions.
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
When selling products as pre-orders, you should not capture payment immediately unless the customer is aware that they are purchasing a product that is not currently available. Instead, you can authorize a payment without capturing the funds immediately. Authorizing a payment at the time of checkout allows you to capture the funds at a later date, when the product is available and you are ready to fulfill the order.
Note: If you communicate to your customers that you are charging them in advance for a product that will ship at a later date, then you are able to capture funds immediately for a pre-order product.
Caution: Authorization periods expire after a certain period of time. After an authorization expires, you may no longer legally capture payment for that order. Shopify Payments has an authorization period of 7 days. To authorize payments for a longer period, you must use a third-party payment gateway.
To change the Add to cart button text for your pre-order products, you must create a new product template.
pre-order
:product.pre-order.liquid
template will open in the code editor.{% section 'product-template' %}
Replace it with:
{% section 'product-pre-order-template' %}
In the same file, look for a
<script>
tag that contains this line of code:addToCart: {{ 'products.product.add_to_cart' | t | json }},
Replace it with:
addToCart: {{ 'Pre-order' | json }},
product-pre-order-template
:product-pre-order-template.liquid
file will open in the code editor. Delete all of the default code, so that the file is blank.product-template.liquid
. Copy all of the content from this file, and paste it into your new product-pre-order-template.liquid
file.product-pre-order-template.liquid
file, find and replace the Add to cart button text.<span data-add-to-cart-text>
{% unless current_variant.available %}
{{ 'products.product.sold_out' | t }}
{% else %}
{{ 'products.product.add_to_cart' | t }}
{% endunless %}
</span>
<span data-add-to-cart-text>
{{ 'Pre-order' | json | remove: '"' }}
</span>
products.product.add_to_cart
with Pre-order
(leaving all other punctuation intact), then your Add to cart button text should change to read Pre-order instead.product-pre-order-template.liquid
file instead.
If you are tracking inventory for a product, then you might want to allow customers to purchase pre-order products even if they have an inventory amount of 0.
To edit the inventory settings for a product:
Note: This setting is available for each variant, so you must change the setting for each one that you would like to be available for pre-order. You can edit all the variants of a product at the same time by using bulk editing.
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Doesnt seem to work. When I create a new product.pre-order.template there is nothing in it. Just 5 lines of code saying the contents can be found in sections. So there is no way for me to alter the template before creating a new section to be used?
Think I commented on the wrong one.
When I create a new product template, it has only 5 lines of code in it, just telling you the contents of that file can be found in the sections file.
I have tried creating a new sections file, copying the code from the existing one, and changing the "addtocart' to 'pre-order' but it doesnt do anything.
Any more suggestions?
I got the same, no script to change... in fact I cannot find add_to_cart anywhere... hoping Ty will respond
Got it to work. The line I found was (line 178) I'm using debut theme
<span id="AddToCartText-{{ section.id }}">
hope this helps!
I'm which script did you find.
I have the debut theme however, mine stops at line 171
The text and fine-print at the end of step 7 in Ty's instructions might help.
same here. I do not see the add to cart line either, only
{% comment %}
The contents of the product.liquid template can be found in /sections/product-template.liquid
{% endcomment %}
{% section 'product-pre-order-template' %}
{% section 'product-recommendations' %}
I have Minimal Theme and even used this method back when I was using Brooklyn Theme:
Create a template > Product > name it pre-order
Change {% section 'product-pre-order' %}
To ‘product-pre-order’%}
Create a section call it product-pre-order
Erase anything that is entered here and replace it with the entire code from the product-template.liquid
Find the line that says
<button type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="AddToCartText">{{ 'Add to Cart' | json | remove: '"' }}
</span>
Replace it with
<button type="submit" name="add" id="Pre-Order" class="btn {{ btn_class }}{% if section.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="PreOrderText">{{ 'Pre-Order' | json | remove: '"' }}
</span>
Save everything
Go back to the product in your store as if you are editing it, near tags it should say product suffix, click on the dropdown menu and select product-pre-order. Preview to make sure it is working properly and save!
Let me know if you still need help
I've edited my templates. But when I go to products to look for the dropdown to change the product to product.preorder I don't see it. Would it have anything to do with using shopify lite?
Did you create the temple “pre-order”?
Okay great, and make sure the new pre-order template says something like this:
{% comment %}
The contents of the product.liquid template can be found in /sections/product-template.liquid
{% endcomment %}
{% section 'product-pre-order' %}
{% section 'product-recommendations' %}
then go back to the product-pre-order.liquid SECTION you created and make sure you’ve tweaked the “button” code to say something like this:
<button type="submit" name="add" id="Pre-Order" class="btn {{ btn_class }}{% ifsection.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="PreOrderText">{{ 'Pre-Order' | json | remove: '"' }}
</span>
</button>
you’re basically removing anything that says addtocart with Pre-Order
if you still can’t find the preorder template in your products edit option then I’m sorry it may have to do with the theme you are using
I used this code and it worked for the first switch if size.
For example:
size small, large, and XL are available then size Medium in sold out.
When I open the page the default size is small and the button says add to card
However when I change it to Large size (even though it is available) it changes to preorder.
How can i solve this?
can you help me do it in the debut theme? 🙂
I cannot get mine working the way I need I was just email not credit cards
Hi having the same issue of not finding the add to cart script.
Are you able to get a solution on this?
I've also been finding its solution for quite a long time, but couldn't find any authentic solution. Please let me know once you found its solution.
Thanks
Regards
I cannot get mine working the way I need I was just email not credit cards PFMLogin
The same thing happens to me when I follow the first two steps. It only shows 5 lines and nothing else to edit!?
Got the pre-order button working - but it still shows "Buy Now". Can we hide that button somehow?
(Also, hi Ty - it's Alex from the App World days)
Figured it out!
Just had to turn off "Show dynamic checkout button" in theme > customize > product section
I have done all that's suppose to do, even turn off "Show dynamic checkout button" in theme as said by ToxonTech. But it's still showing both the 'pre-order' button and also below it shows the 'Buy it Now' button.
How to take that off?
Anybody figure this out? I still can't get rid of the Buy it Now button under the Pre-Order button.
Hey before starting the blog he mention about payments provider to do it on manually do that steps the buy it now button will disappear .Still Any query askme at amitj4111@gmail.com
I was able to disable it by adding comments tags as per instructions here.
Hope it helps
is there specific themes to apply this feature?
Hi @ToxonTech,
Don't know if this is still relevant but I solved this one by commenting out / deleting the lines that show the payment button, which is just a couple lines below the preorder button code:
Aka delete this code:
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
Tried this! still all of my items are on pre-order even thought some of them are available
You have to switch templates
Already did! Still not working! all of my items show now PRE-ORDER
I just want the ones that are out of stock to show PRE-ORDER the other ADD TO CART
hi @Jennifer42
I spent a little time coding trying to accomplish that this morning - basically it will be a serious coding job - not just one to two lines of code like the above.
Without coding, the easiest thing to do will be to use one template for items that are in stock and another template for items that are out of stock. I will look into tools to automatically update the template when the stock level changes... and I will also look into accomplishing this with code. If i find the time to make it happen, i'll share my code here.
User | RANK |
---|---|
143 | |
96 | |
76 | |
70 | |
69 |
This blog post is a recap of the webinar Getting Ready For BFCM: How To Run A Flash Sal...
By Jacqui Oct 3, 2023Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023