Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all,
I need to modify the Add to Cart button text to show "Place Special Order" when an item has SpecialOrder:Y as a product tag. I see in the product-info.liquid file there is this line of code:
{%- else -%}
<button type="submit" class="product-form__add-button button button--primary" data-action="add-to-cart">{{ 'product.form.add_to_cart' | t }}</button>
{%- endif -%}
However, I can't find what to edit to change the Add to Cart button text or if this is even the correct line to edit.
I'm thinking I can add an if statement like so, so that only items with that tag get changed:
{%- if product.tags contains 'SpecialOrder:Y' -%}
I'm not sure of the best place to put it, and what exactly would go in it. Any help would be appreciated. Currently using the theme warehouse.
Solved! Go to the solution
This is an accepted solution.
If that code above is for the add to cart button, then I would just copy that same format.
{% if product.tags contains "SpecialOrder" %}
<button type="submit" class="product-form__add-button button button--primary" data-action="add-to-cart">Special text to show on ATC button</button>
{% else %}
<button type="submit" class="product-form__add-button button button--primary" data-action="add-to-cart">{{ 'product.form.add_to_cart' | t }}</button>
{% end %}
To test this, duplicate your live theme then make the edits in the new theme.
Usually this would be found in a file like product-info.liquid, product-form.liquid, etc. If you can't find it, start with the product.liquid template and read the code to see each of the snippets that are added, then open those files and look for add to cart code.
This is an accepted solution.
If that code above is for the add to cart button, then I would just copy that same format.
{% if product.tags contains "SpecialOrder" %}
<button type="submit" class="product-form__add-button button button--primary" data-action="add-to-cart">Special text to show on ATC button</button>
{% else %}
<button type="submit" class="product-form__add-button button button--primary" data-action="add-to-cart">{{ 'product.form.add_to_cart' | t }}</button>
{% end %}
To test this, duplicate your live theme then make the edits in the new theme.
Usually this would be found in a file like product-info.liquid, product-form.liquid, etc. If you can't find it, start with the product.liquid template and read the code to see each of the snippets that are added, then open those files and look for add to cart code.
Worked perfectly, I just added an else if statement with this line and all is good.
{% elsif product.tags contains 'SpecialOrder:Y' %}
<button type="submit" class="product-form__add-button button button--primary" data-action="add-to-cart">Place Special Order</button>
Thank you for the assistance!
Woohooo!
Hey, this is super nice and works for me too on Dawn! However, if I change to another variant of the product it changes back to Add to cart - any idea how to prevent this from happening?
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025