How to hide prices of sold out items within the 'Boundless' Theme

Solved
old_jewelry
Tourist
4 0 1

Hello, looking for a solution to hide prices for sold out items in the 'Boundless' theme.
All of my sold out items are located in a collection named 'archive' which is visible to shoppers but I would like to hide the prices. 

Thanks in advance for any help! 

KetanKumar
Shopify Partner
20633 2141 7814

Hello, @old_jewelry 

Welcome to the Shopify community!
and Thanks for your Good question.

Please share your site URL,
So I will check and provide a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
old_jewelry
Tourist
4 0 1
thank you!

oldjewelry.net
0 Likes
Diamond_Team
Pathfinder
64 14 20

Hello,

1. In your Shopify Admin go to online store > themes > actions > edit code

2- Go to Sections folder > product-template.liquid

3- press ctrl + f and type assign price to search for it

4- add this line of code just above it

 

          {% if product.available %}

 

5- add this line just under the </p>

 

          {% endif %}

 

6- click save

The final code should look like that:

code.PNG

Best regards,

Diamond team

 

If the answer was helpful for you, then please Like and Accept the Solution.
Get our new boundless theme product page template from here
Want modifications or custom changes on a store contact us
Email: diamondteam4coding@gmail.com
0 Likes
old_jewelry
Tourist
4 0 1
Hello,

This hides the price on each individual product page (if sold out)
But does not hide the prices on the archive page, where all sold out items
are displayed.
Please see attached screenshot....
[image: Screen Shot 2020-12-06 at 10.49.59 AM.png]
0 Likes
Diamond_Team
Pathfinder
64 14 20

This is an accepted solution.

Hello,

To hide the price of sold out items from collection pages:

 

1. In your Shopify Admin go to online store > themes > actions > edit code

2- Go to Snippets folder > product-grid-item.liquid

3- press ctrl + f and search for product-item__price-wrapper

4- add this line of code just above it

 

 

          {% if product.available %}

 

5- add this line just under the </p>

 

   {% endif %}

 

6- click save

The final code should look like that:

code.PNG

Best regards,

Diamond Team

If the answer was helpful for you, then please Like and Accept the Solution.
Get our new boundless theme product page template from here
Want modifications or custom changes on a store contact us
Email: diamondteam4coding@gmail.com
old_jewelry
Tourist
4 0 1

Thank you so much! 
This worked!

0 Likes
xdreamineer
Excursionist
16 0 6

Hi,

I am using Them Simple.

Can you help showing me how it works for my store?

Url: planet.deluxe-myshopify

 

Thanks

0 Likes
Diamond_Team
Pathfinder
64 14 20

Hello xdreamineer,

For hiding the price of soldout items from product page:

1. In your Shopify Admin go to online store > themes > actions > edit code

2- Go to Sections folder >product-template.liquid

3- press ctrl + f and search for product-single__prices

4- add this line of code just above it

 

 {% if product.available %}

 

5- add this line just under the </p>

          {% endif %}

6- click save

The final code should look like that:

product page code.PNG

 

If the answer was helpful for you, then please Like and Accept the Solution.
Get our new boundless theme product page template from here
Want modifications or custom changes on a store contact us
Email: diamondteam4coding@gmail.com
0 Likes
Diamond_Team
Pathfinder
64 14 20

To hide the price of sold out items from collection pages:

1. In your Shopify Admin go to online store > themes > actions > edit code

2- Go to Snippets folder >product-grid-item.liquid

3- replace all the code inside this folder with this code:

 

 

{% unless grid_item_width %}
  {% assign grid_item_width = 'medium-up--one-third small--one-half' %}
{% endunless %}

{% unless current_collection == blank %}
  {% assign current_collection = collection %}
{% endunless %}

{% assign on_sale = false %}
{% assign sale_text = 'products.product.sale' | t %}
{% if product.compare_at_price > product.price %}
  {% assign on_sale = true %}
{% endif %}

{% assign sold_out = true %}
{% assign sold_out_text = 'products.product.sold_out' | t %}
{% if product.available %}
  {% assign sold_out = false %}
{% endif %}

{%- assign img_url = product.featured_image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

<div class="product grid__item {{ grid_item_width }} slide-up-animation animated" role="listitem">
  {% unless product.featured_image == blank %}
    <div class="supports-js" style="max-width: {{ 600 | times: product.featured_image.aspect_ratio | round }}px; margin: 0 auto;">
      <a href="{{ product.url | within: collection }}" class="product__image-wrapper product__image-wrapper--loading" style="padding-top:{{ 1 | divided_by: product.featured_image.aspect_ratio | times: 100}}%;" title="{{ product.title | escape }}" data-image-link>
        <img class="product__image lazyload"
             alt="{{ product.featured_image.alt | escape }}"
             style="max-width: {{ 600 | times: product.featured_image.aspect_ratio | round }}px; max-height: 600px;"
             data-src="{{ img_url }}"
             data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
             data-aspectratio="{{ product.featured_image.aspect_ratio }}"
             data-sizes="auto"
             data-image>
      </a>
    </div>
  {% else %}
    <a href="{{ product.url | within: collection }}" class=" supports-js product__image-wrapper" title="{{ product.title | escape }}">
      <img src="{{ product.featured_image.src | img_url: 'grande' }}" alt="{{ product.featured_image.alt | escape }}">
    </a>
  {% endunless %}

  <noscript>
    <a href="{{ product.url | within: collection }}" class="product__image-wrapper" title="{{ product.title | escape }}">
      <img src="{{ product.featured_image.src | img_url: 'grande' }}" alt="{{ product.featured_image.alt | escape }}">
    </a>
  </noscript>

  <div class="product__title product__title--card text-center">
    <a href="{{ product.url | within: collection }}">{{ product.title }}</a>
  </div>

  {% if section.settings.vendor_show %}
    <div class="product__vendor text-center">
      {{ product.vendor }}
    </div>
  {% endif %}

  <div class="product__prices text-center">
   {% if product.available %}
    {% if product.compare_at_price > product.price %}
      <span class="product__price--on-sale">
        {% if product.price_varies %}
          {% assign sale_price = product.price | money %}
          {{ 'products.product.on_sale_from_html' | t: price: sale_price }}
        {% else %}
          <strong class="visually-hidden">{{ 'products.product.sale_price' | t }}</strong>
          {{ product.price | money }}
        {% endif %}
      </span>

    {% else %}

      <span class="product__price">
        {% if product.price_varies %}
          {% assign price = product.price | money %}
          {{ 'products.product.from_text_html' | t: price: price }}
        {% else %}
          <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
          {{ product.price | money }}
        {% endif %}
    </span>
     {% endif %}


    {% if product.compare_at_price > product.price %}
      <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
      <s>{{ product.compare_at_price | money }}</s>
    {% endif %}
   {% endif %}
    {% if on_sale %}
      <span class="badge badge--sale"><span>{{ 'products.product.on_sale' | t }}</span></span>
    {% endif %}

    {% comment %}
    {% if sold_out %}
      <span class="badge badge--sold-out"><span>{{ 'products.product.sold_out' | t }}</span></span>
    {% endif %}
    {% endcomment %}

    {% if sold_out %}
      — <strong class="sold-out-text">{{ 'products.product.sold_out' | t }}</strong>
    {% endif %}

    {% if product.price_varies == false %}
      {% include 'product-unit-price', variant: product.selected_or_first_available_variant %}
    {% endif %}
  </div>
</div>

 

Copy

4- click save

 

Best regards,

Diamond team

 

If the answer was helpful for you, then please Like and Accept the Solution.
Get our new boundless theme product page template from here
Want modifications or custom changes on a store contact us
Email: diamondteam4coding@gmail.com