How do I change 'add to cart' wording to read 'pre-order' when using specific template?

Solved

How do I change 'add to cart' wording to read 'pre-order' when using specific template?

oysterpots
Shopify Partner
19 0 2

Hello, I'm working on a client's site: maisonmargauxltd.com and have created a template for products that are available to pre-order (pre-order-2). Site is built with the Prestige 7.3.6 theme.

 

Client would like me to change the wording on the button from 'add to cart' to  “Pre-order Now” / “Reserve Yours” / “Order for May 15th” or similar.

 

Could anyone help with the code required for this please? I'm familiar with implementing code but less so with writing it!

 

Thanks in advance

Accepted Solution (1)

rajweb
Shopify Partner
822 71 155

This is an accepted solution.

Hey @oysterpots ,

Code (for main-product.liquid or similar section)

Find your Add to Cart button in the product section (sections/main-product.liquid or similar), and replace it with this:

{% if template.name == 'product.pre-order-2' %}
  <button type="submit" name="add" class="product-form__submit button button--primary">
    Pre-order Now
  </button>
{% else %}
  <button type="submit" name="add" class="product-form__submit button button--primary">
    {{ 'products.product.add_to_cart' | t }}
  </button>
{% endif %}

Would you like to use dynamic text like “Order for May 15th” based on the product?

Thanks

Rajat 

Rajat | Shopify Expert Developer
Need a reliable Shopify developer for your next project?
Our App: Productify Groups App
Email: rajat.shopify@gmail.com
Portfolio: https://rajatweb.dev

View solution in original post

Replies 4 (4)

rajweb
Shopify Partner
822 71 155

This is an accepted solution.

Hey @oysterpots ,

Code (for main-product.liquid or similar section)

Find your Add to Cart button in the product section (sections/main-product.liquid or similar), and replace it with this:

{% if template.name == 'product.pre-order-2' %}
  <button type="submit" name="add" class="product-form__submit button button--primary">
    Pre-order Now
  </button>
{% else %}
  <button type="submit" name="add" class="product-form__submit button button--primary">
    {{ 'products.product.add_to_cart' | t }}
  </button>
{% endif %}

Would you like to use dynamic text like “Order for May 15th” based on the product?

Thanks

Rajat 

Rajat | Shopify Expert Developer
Need a reliable Shopify developer for your next project?
Our App: Productify Groups App
Email: rajat.shopify@gmail.com
Portfolio: https://rajatweb.dev
oysterpots
Shopify Partner
19 0 2

Hi Rajat,

 

I've just tried this and it's worked perfectly!

 

Thank you so much,

Lottie

rajweb
Shopify Partner
822 71 155

Hey Lottie,

I'm really glad to hear it worked perfectly!

If you found it helpful, I’d really appreciate it if you could give it a Like and mark it as the Solution on the forum—it helps others too!

Thanks again,

Rajat

Rajat | Shopify Expert Developer
Need a reliable Shopify developer for your next project?
Our App: Productify Groups App
Email: rajat.shopify@gmail.com
Portfolio: https://rajatweb.dev
oysterpots
Shopify Partner
19 0 2

Absolutely! Thank you again 😊