Re: Change ''Add to cart'' for ''Pre order'' on a specific product

Change ''Add to cart'' for ''Pre order'' on a specific product

514rpm
Tourist
10 0 2

Hi,

 

I'm looking for a way to change the button ''Add to cart'' for ''Pre order'' on a specific product but so far nothing works or it does it for the whole website.

 

I'm using the theme Dawn 9.00

 

Here is the link to my store

https://514rpm.com/

 

Here is the item the I'm talking about

https://514rpm.com/products/spotify-barcode

 

Thank you!

 

Replies 5 (5)

Dan-From-Ryviu
Shopify Partner
9212 1846 1878

You can create a new template for product that you want pre order button instead of add to cart button.

Please check this instruction to know how to create a new template 

https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates#create-a-new-templa...

- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

dmwwebartisan
Shopify Partner
12321 2552 3727

@514rpm 

You could try the following:

 

In step 10 of the tutorial (https://help.shopify.com/en/themes/customization/products/add-to-cart/allow-pre-orders#sectioned-th...), keep the following code unchanged (ie. don't replace it):

<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>

Then in the theme.liquid file, replace the following line of code (the one mentioned in Lizzy's reply):

addToCart: {{ 'products.product.add_to_cart' | t | json }}

with

addToCart: {%- if template.suffix == 'pre-order' -%}{{ 'Pre-order' | json }}{%- else -%}{{ 'products.product.add_to_cart' | t | json }}{%- endif -%}

Make sure you don't accidentally delete the comma at the end of the line when making your changes.  Hope this helps!

 

Please note I haven't tested this code, so cannot make any assurances that it will work.  

 

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com |  Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | #1 Product Filter & Search app on Shopify | The most powerful Shopify page builder app

suyash1
Shopify Partner
9783 1214 1554

@514rpm - this will need code editing, are you familiar with the liquid coding?

To build shopify pages use pagefly | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30. | Support me
514rpm
Tourist
10 0 2

Sure I'm familiar with code editing, Do you know what to modify?

suyash1
Shopify Partner
9783 1214 1554

@514rpm - open product.liquid page and check template handle.... if this handle matches this specific product which you want, then you can change the text

 

you can refer to the code given by @dmwwebartisan ... exact code is difficult to provide here as we do not know what has been used in product liquid file

To build shopify pages use pagefly | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30. | Support me