Changing the 'Add To Cart' Button text for different products - Brooklyn

Highlighted
New Member
2 0 0

Hey All, 

Some of my products will be 'available' for purchase and some will be for 'pre-order'. I have created a new Template & Section so that I can put my products under the different template suffix (product vs product.pre-order). 

Where do I change the text for the new product.pre-order template so that the 'Add to Cart' text is replaced with 'Pre Order' instead? 

I have tried going to en.default.json file and added in "pre_order": "Pre Order",

Then have gone to the new template and changed the {{ 'products.product.add_to_cart' | t }} to {{ 'products.product.pre_order' | t }}  

<div class="product-single__add-to-cart{% if section.settings.add_to_cart_button_size == 'large' %} product-single__add-to-cart--full-width{% endif %}">             
                <button type="submit" name="add" id="AddToCart--{{ section.id }}" class="btn btn--add-to-cart{% if section.settings.enable_payment_button %} btn--secondary-accent{% endif %}"{% unless current_variant.available %} disabled="disabled"{% endunless %}>
                  <span class="btn__text">
                    {% if current_variant.available %}
                      {{ 'products.product.pre_order' | t }}
                    {% else %}
                      {{ 'products.product.sold_out' | t }}
                    {% endif %}
                  </span>

 

I also want to hide the 'Buy Now' button when using this new template.

Where did I go wrong? 

0 Likes
Highlighted
Shopify Partner
1675 362 493

Hey @adides,

How did you put your translation in the en.default.json file?

Can you provide a screenshot?

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
2 0 0

Hey @dmwwebartisan , I've just added an extra line for pre_order as the below: 

"product": {
"sold_out": "Sold Out",
"sold_out_html": "Sold<br \/> Out",
"unavailable": "Unavailable",
"quantity": "Quantity",
"add_to_cart": "Add to Cart",
"pre_order": "Pre Order",
"full_details": "Full details"
},

0 Likes