Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, I would like to modify the text out of stock and change it to sold out.
I would also like the text to be in the middle of the photo instead of in the bottom right.
as I have it:
how I want it:
To modify the "Out of Stock" text and change it to "Sold Out" in the middle of the product photo, you will need to make some modifications to your Shopify theme's code. Here are the steps you can follow:
From your Shopify admin, go to "Online Store" and click on "Themes".
Locate the current theme you're using and click on "Actions" > "Edit Code".
In the left sidebar, under "Sections", click on the "product-card-grid-item.liquid" or "product-card-list-item.liquid" file, depending on the type of product listing you're using (grid or list).
Look for the section of code that displays the product's availability or stock status. It might look something like this:
{% if product.available %}
<span class="product-card__availability">In Stock</span>
{% else %}
<span class="product-card__availability">Out of Stock</span>
{% endif %}
Replace the "Out of Stock" text with "Sold Out" or any other desired text. Additionally, you can add a CSS class or style to center-align the text. For example:
{% if product.available %}
<span class="product-card__availability">In Stock</span>
{% else %}
<span class="product-card__availability product-card__availability--sold-out">Sold Out</span>
{% endif %}
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025