Debut theme - when a product is 'sold out' - show 'sold out' text, price and comparison price

Highlighted
New Member
1 0 0

Hi there,

 

I am using the Debut theme and would like to achieve the following:

 

- when an item is sold out, show the text 'sold 'out, as well as the current and comparison price.

 

At the moment it shows the 'sold out' text + comparison price. 

 

If what I am trying to achieve is not possible, as I able to have it so it displays
'sold out' text + current price?

 

I've had a look at the code but can't seem to work this one out. 

 

The current relevant code I can find it as follows:

product-info.liquid

<div class="product-details">
<span class="title" itemprop="name">{{ product.title }}</span>
{% if settings.enable_shopify_collection_badges %}
<div class="shopify-reviews reviewsVisibility--{{settings.enable_shopify_review_comments}}">
<span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
</div>
{% endif %}
{% if settings.display_vendor %}
<span itemprop="brand" class="brand">{{ product.vendor }}</span>
{% endif %}

{% if collection_handles contains 'coming-soon' %}
<span class="modal_price">{{ 'collections.general.coming_soon' | t }}</span>
{% else %}
<span class="price {% if product.compare_at_price_max > product.price %}sale{% endif %}">
{% if product.available %}
{% if product.price_varies and product.price_min > 0 %}
<small><em>{{ 'products.general.from' | t }}</em></small>
{% endif %}
{% if product.price_min > 0 %}
<span class="money">{{ product.price_min | money }}</span>
{% else %}
{{ settings.free_price_text }}
{% endif %}
{% else %}
<span class="sold_out">{{ 'products.product.sold_out' | money }}</span>
{% endif %}
{% if product.compare_at_price_max > product.price %}
<span class="was_price">
<span class="money">{{ product.compare_at_price_max | money }}</span>
</span>
{% endif %}
</span>
{% endif %}
</div>

 

and 

 

product-template.liquid

 


{% if collection_handles contains 'coming-soon' %}
<p class="modal_price">{{ 'collections.general.coming_soon' | t }}</p>
{% else %}
<p class="modal_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="{{ shop.currency }}" />
<meta itemprop="seller" content="{{ shop.name | escape }}" />
<link itemprop="availability" href="http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"/>

<span class="sold_out">{% if variant.available == false %}{{ 'products.product.sold_out' | t }}{% endif %}</span>
<span itemprop="price" content="{{ variant.price | money_without_currency | remove: "," }}" class="{% if variant.compare_at_price > variant.price %}sale{% endif %}">
<span class="current_price {% if product.available == false %}hidden{% endif %}">
{% if variant.price > 0 %}
<span class="money">{{ variant.price | money }}</span>
{% else %}
{{ settings.free_price_text }}
{% endif %}
</span>
</span>
<span class="was_price">
{% if variant.price < variant.compare_at_price and variant.available %}
<span class="money">{{ variant.compare_at_price | money }}</span>
{% endif %}
</span>

 

 

0 Likes