Shopify themes, liquid, logos, and UX
Hi Team,
I sell a lot of items that are a Print to Order, however I keep SOME stock on hand.
I would like to change my "Add to Cart" button to say "Pre-Order", "Order In" (something along these lines) for when my inventory is set to continue selling on zero stock items.
The Pre-Order apps don't really suit my needs as I require payment at time of order to start making it.
Hoping there may be a code somewhere I can change instead to show the buttons variation depending on if there is physical store, or it is print to order? (Currently Venture Theme)
Thanks!
Please follow the following steps carefully.
"Pre-Order": "Pre-Order",
Now Go to the "product-template.liquid" file and change the highlighted code with the new one.
New code
{%- if product.tags contains 'Preorder' -%}
{{ 'products.product.Pre-Order' | t }}
{%- elsif current_variant.available -%}
{{ 'products.product.add_to_cart' | t }}
{% else %}
{{ 'products.product.sold_out' | t }}
{%- endif -%}
Now go to single product editor, if you select Track Quantity please also check the below option
"Continue selling when out of stock".
In the single product editor, on the right side menu, under the tags of product add the tag "Preorder". (this tag should match the tag on the first line of code that I shared).
please apply these changes and let me know if there is an error.
@Ahsan_ANC Can you please outline the same steps for adding this code to the Colorblock theme? (It's just different enough from Venture that I worry about messing up.)
Thanks!
Hi @Meandering Please replace the code highlighted in the below screenshot with the new code
{%- if product.tags contains 'Preorder' -%}
Pre-Order
{%- elsif product.selected_or_first_available_variant.available -%}
{{ 'products.product.add_to_cart' | t }}
{% else %}
{{ 'products.product.sold_out' | t }}
{%- endif -%}
the new look should be like this
Hi, I've tried to get this to work with the Ride theme, it still says "add to cart"
have you done all steps?
Hi! I'm looking to do the same thing as the original person, except change the badge from "out of stock" to "call to order," I'm using my shopify website as a catalog. Thanks!
Hi @Ahsan_ANC this is an amazing tutorial and it does exactly what I was looking to do, but with one exception. Most of my products have variants, and often I have certain variants in stock but while others are not in stock in which case I would like to show the Pre-Order option.
The issue I found is that when make the changes above, when the product first loads it correctly show the Pre-Order button, but if I switch to a different variant it goes back to showing Add To Cart.
Is there a way to show the Pre-Order button for only the variants that are not in stock?
Hi @pcebo for variants to show pre order we will need to change the javascript code.
Hi @Ahsan_ANC is this something you can help with? I would really appreciate it.
Which theme you are using?
I'm using the Venture theme.
Hi Ahsan,
Is it possible to tick this option automatic if preorder tag available
"Continue selling when out of stock".
yes
How please can you advise step
try replacing this line
{%- if product.selected_or_first_available_variant.available -%}
with
{%- if product.selected_or_first_available_variant.available or product.tags contains 'Preorder' -%}
please keep the preorder the same as in the above code. Shopify is case-sensitive in it
Preorder
Hi
I am trying to add to my theme file but I can not find as per your picture
would you able to check
Not the exact instructions for the "Ride" theme but gave me the general idea on how to get it done and I managed to get it working. Thanks!
Can you also do this for the Craft theme?
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024