Looking for instructions to change the text on the "add to cart" button in a 2.0 theme

Looking for instructions to change the text on the "add to cart" button in a 2.0 theme

Glazebits
Tourist
3 0 0

I'm wanting to change the text on a few products (so likely need to create a new product template/section), so the add to cart button says "pre-order" instead of "add to cart." I've found instructions on how to do it on the minimal theme but it didn't work on the 2.0 themes and I can't find anything that explains it or how to alter it for 2.0
Any assistance would be appreciated.

For reference this is the code I found for the minimal theme: https://community.shopify.com/c/shopify-design/setup-pre-order-template-w-minimal-theme/td-p/653145?...

Replies 3 (3)

PaulNewton
Shopify Partner
7722 678 1627

You have to find which files with different names that contain the relevant areas of code.

The implementation details will vary wildly between themes especially now with OS2.0 themes in the mix.

For example the text may be set in section main-product.liquid, or needs to be set in a snippet like product-form.liquid or some other naming convention.

 

There is that vintage pre-order tutorial which can still be instructive to go through completely with an unpublished vintage theme to know some basics to then try to apply to an OS2.0 theme.

https://community.shopify.com/c/shopify-design/product-pages-allow-pre-orders-for-products/td-p/6164...   

 

Though be aware such customizations generally only work as static displays, and not dynamically so changing variants may require the page to be reloaded unless you do a full javascript integration.

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Tristram
Shopify Partner
90 12 22

 

Could you find the line that displays the "add to cart" in your product liquid page?

What theme are you working with?

 

DigitalConsultant.xyz

Cedcommerce
Shopify Partner
718 77 116

Hello @Glazebits,

 

You can do this by adding a custom code in your theme file that will change the button text on the basis of provided specific conditions.

 

You have to enable the "continue selling when out of stock" option for each variant of the product. You can add the custom code in multiple files based on your theme. 

 

Also, please follow the above instructions if you have knowledge about theme files and Shopify code otherwise we suggest you hire a Shopify expert or connect with us, and we will help you to enable this option. 

 

You can also contact theme support if you are using any paid theme.

 

We are providing you the custom code below that you need to add to your theme file:-

 

{% if variant.quantity <= 0 and variant.inventory_policy == "continue" %}

 Pre order

{% else %}

 Add to cart

{% endif %}

 

Hope this helps, let us know if you have any other questions.

 

All the best, 

CedCommerce

CedCommerce || Shopify Expert
- Let us know if our reply is helpful for you. Like it.
- Was your question answered? Mark it as an accepted solution.
- For further discussion contact: Email ID- apps@cedcommerce.com
- Whatsapp:- Join Here