How Can I Personalise The Sold Out Text And Put It In The Centre Of The Product?

How Can I Personalise The Sold Out Text And Put It In The Centre Of The Product?

milo1832
Tourist
10 0 3

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:

 

Captura de pantalla 2023-05-08 a las 21.41.07.png

 

how I want it:

 

Captura de pantalla 2023-05-08 a las 21.41.38.png

Reply 1 (1)

NomtechSolution
Astronaut
1245 113 160

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:

  1. From your Shopify admin, go to "Online Store" and click on "Themes".

  2. Locate the current theme you're using and click on "Actions" > "Edit Code".

  3. 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).

  4. 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 %}