How can I hide sold prices on the Boost 6.2 theme?

Hello,

I have moved to the new Boost 6.2 theme and need to customise some code - I previously had this in place with the old theme, however it was not carried across in the code.

I would like to hide the prices of items from both the Collections pages and Products pages when the product sells.

I have tried a number of solutions posted on other pages, but as these seem to be for other themes they don’t work.

Would really appreciate any guidance, please! Thank you in advance.

@StanSavellis Can you please share the site url here?

Of course - sorry:

https://thatretropiece.com/

Any help at all?

Hey @StanSavellis i will surely help you but site is restricted here.

Thanks

Please let me know your location (country) and I will unblock.

@StanSavellis It’s INDIA.

Thanks

I’ve just unblocked India now, so you should be fine to access. Thank you.

@StanSavellis Hey thanks , got the access. can you please explain a little bit more with some screenshots? it will really help me to fix your issue easily.

Thanks

Sure - once a product is sold I’d like to hide the sold price, from the Products and Collections pages. I’ve circled what I’m referring to on the screenshot.

I had this set up on my previous theme but needed to update to new theme version and the codes didn’t carry across.

Also, here, on the Products page.

Hey @StanSavellis please search for “product-price” in collection page and product page files.

It will be “price.liquid” file in common.

Now add the condition over the {{ price of product(It is an example) }} class.

Wrap this with the below condition.

{% unless product.available %}
price of product
{% endunless %}

Thanks

Please confirm, in this section here?

Hey @StanSavellis this is not the correct file. If you don’t mind can you please share me the code for “product-template-product-list” and “product-block” files.

Thanks in advance

This is the first one:

{% if section.settings.hide_if_empty == false or section.settings.product_list != blank %}
{%- liquid
if section.settings.enable_carousel == true
assign show_carousel_nav = true

if section.settings.product_list != blank and section.settings.product_list.size <= section.settings.grid
assign show_carousel_nav = false
endif
else
assign show_carousel_nav = false
endif
-%}

{%- if section.settings.title != blank or section.settings.link_text != blank or section.settings.enable_carousel == true -%}
{% if section.settings.title != blank %}

{{ section.settings.title | escape }}

{% endif %}

{% if section.settings.link_text != blank %}
{{ section.settings.link_text | escape }}
{% endif %}

{% endif %}
{%- if show_carousel_nav -%}
{% render 'feather-arrow-left' %}
{%- endif -%}
{%- assign grid_class = 'one-quarter' -%} {%- if section.settings.grid == 2 -%} {%- assign grid_class = 'one-half' -%} {%- elsif section.settings.grid == 3 -%} {%- assign grid_class = 'one-third' -%} {%- elsif section.settings.grid == 5 -%} {%- assign grid_class = 'one-fifth' -%} {%- endif -%}

{%- if section.settings.grid_mobile == “2” -%}
{%- assign mobile_grid_class = ‘small-down–one-half’ -%}
{%- else -%}
{%- assign mobile_grid_class = ‘small-down–one-whole’ -%}
{%- endif -%}
{% capture grid_class_list %}{{ grid_class }} {{ mobile_grid_class }} grid-flex__item{% endcapture %}

{% for product in section.settings.product_list %}
{% assign quickbuy_toggle = settings.quickbuy_buttons_toggle %}
{% render ‘product-block’, quickbuy: quickbuy_toggle, product: product, grid_class: grid_class_list, show_vendor: section.settings.show_vendor %}
{%- else -%}
{%- liquid
if section.settings.enable_carousel == true
assign placeholder_count = 8
else
assign placeholder_count = section.settings.grid
endif
-%}
{% for i in (1..placeholder_count) %}

{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg placeholder-svg--small' }}
{{ 'homepage.onboarding.product_title' | t }}
{%- if settings.product_currency_code_enabled -%} {{- 2000 | money_with_currency -}} {%- else -%} {{- 2000 | money -}} {%- endif -%}
{% endfor %} {% endfor %}

{%- if show_carousel_nav -%}

{% render 'feather-arrow-right' %}
{% render 'peek-carousel-advice' %} {%- endif -%}
{% endif %}

{% schema %}
{
“name”: “Product list”,
“tag”: “section”,
“class”: “section-product-template-product-list”,
“settings”: [
{
“type”: “text”,
“id”: “title”,
“label”: “Heading”,
“default”: “Product list”
},
{
“type”: “checkbox”,
“id”: “enlarge_title”,
“label”: “Enlarge heading”,
“default”: false
},
{
“type”: “text”,
“id”: “link_text”,
“label”: “Link text”,
“default”: “Shop now”
},
{
“type”: “url”,
“id”: “link_url”,
“label”: “Link URL”
},
{
“type”: “product_list”,
“id”: “product_list”,
“label”: “Product list”
},
{
“type”: “checkbox”,
“id”: “hide_if_empty”,
“label”: “Hide section if product list is empty”,
“info”: “Useful when using a dynamic source”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“label”: “Show vendor”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “enable_carousel”,
“label”: “Enable carousel”,
“default”: false
},
{
“type”: “range”,
“id”: “grid”,
“label”: “Desktop products per row”,
“min”: 2,
“max”: 5,
“step”: 1,
“default”: 4
},
{
“type”: “select”,
“id”: “grid_mobile”,
“label”: “Mobile products per row”,
“options”: [
{
“value”: “1”,
“label”: “1”
},
{
“value”: “2”,
“label”: “2”
}
],
“default”: “2”
}
],
“presets”: [
{
“name”: “Product list”
}
],
“enabled_on”: {
“templates”: [
“product”
]
}
}
{% endschema %}

And the second one:

0 %} data-cc-animate-delay="{{ animate | times: 0.07 }}s"{% endif %}{% endif %}>
{%- if product.featured_media != blank -%}
{% liquid if settings.product_grid_image_shape == 'natural' assign aspect_ratio = false elsif settings.product_grid_image_shape == 'square' assign aspect_ratio = 1.0 elsif settings.product_grid_image_shape == 'landscape-32' assign aspect_ratio = 1.5 elsif settings.product_grid_image_shape == 'landscape-54' assign aspect_ratio = 1.25 elsif settings.product_grid_image_shape == 'portrait-45' assign aspect_ratio = 0.8 elsif settings.product_grid_image_shape == 'portrait-23' assign aspect_ratio = 0.67 endif %} {% render 'responsive-image', image: product.featured_media.preview_image, aspect_ratio: aspect_ratio %}
{%- if settings.hover_image_enabled == true and product.media.size > 1 -%}
{{ product.media[1].preview_image.alt | escape }}
{%- endif -%} {%- else -%} {{- product.featured_media.preview_image | img_url: '600x600' | img_tag -}} {%- endif -%}

{%- if quickbuy -%}

{{ 'products.quickbuy.quick_buy' | t }} {% render 'quick-buy-placeholder', product: product %}
{%- endif -%}
{% capture the_snippet_review_avg %}{% render 'ssw-widget-avg-rate-listing', product: product %}{% endcapture %} {% unless the_snippet_review_avg contains 'Liquid error' %} {{ the_snippet_review_avg }} {% endunless %}

{%- if show_vendor -%}

{{- product.vendor -}}
{%- endif -%}
{%- assign cheapest_variant = product.variants | sort: 'price' | first -%} {% render 'unit-price', variant: cheapest_variant %}

{% if product.price_varies %}
{{ ‘products.product.from_text’ | t }}
{% endif %}

{%- if settings.product_currency_code_enabled -%} {{- cheapest_variant.price | money_with_currency -}} {%- else -%} {{- cheapest_variant.price | money -}} {%- endif -%}

{% if cheapest_variant.compare_at_price > cheapest_variant.price %}
{{ ‘products.product.regular_price’ | t }}
{{ cheapest_variant.compare_at_price | money }}
{% endif %}

{% if product.available %}
{% if cheapest_variant.compare_at_price > cheapest_variant.price and settings.sale_label_enabled %}
{{ ‘products.product.on_sale’ | t }}
{% endif %}
{% elsif settings.sold_label_enabled %}
{{ ‘products.product.sold_out’ | t }}
{% endif %}

{%- if settings.swatch_enabled_grid -%}
{%- liquid
assign swatch_count = 0
assign swatch_mobile_limit = 3
-%}

{%- for product_option in product.options_with_values -%} {%- liquid if settings.swatch_enabled_productpage and settings.swatch_option_name contains product_option.name assign is_swatch = true else assign is_swatch = false endif -%} {%- if is_swatch == true -%} {%- assign product_option_position_0index = product_option.position | minus: 1 -%} {%- for product_option_value in product_option.values -%}

{%- liquid
assign option_value_variant = false
for variant in product.variants
if variant.options[product_option_position_0index] == product_option_value
assign option_value_variant = variant
break
endif
endfor

if is_swatch and settings.swatch_method == ‘image’ and option_value_variant.featured_media == blank
continue
endif

assign swatch_count = swatch_count | plus: 1
-%}

<span class=“{% if settings.swatch_method == ‘image’ %}product-swatch-inline__image {% else %}product-swatch-inline__dot {% endif %}rimage-background fade-in lazyload”
data-option-item=“{{ product_option_value | downcase | escape }}”
{%- if settings.swatch_method == ‘standard’ -%}
data-swatch=“{{ product_option_value | downcase | replace: '”', ‘’ }}"
{%- elsif settings.swatch_method == ‘image’ and option_value_variant.featured_media -%}
data-bgset=“{{ option_value_variant.featured_media.preview_image | img_url: ‘80x80’, crop: settings.swatch_crop_align }}” data-parent-fit=“cover”
{%- endif -%}>

{%- endfor -%}
{%- endif -%}
{%- endfor -%}

{%- if settings.swatch_method == ‘image’ and swatch_count > swatch_mobile_limit -%}
{%- assign remaining = swatch_count | minus: swatch_mobile_limit -%}
{{ ‘collections.general.more_swatches’ | t: count: remaining }}
{%- endif -%}

{%- endif -%}

{%- if settings.enable_product_reviews_collection and product.metafields.reviews.rating_count != blank -%}
{%- assign rating_count = product.metafields.reviews.rating_count | plus: 0 -%}
{%- if rating_count > 0 -%}

{% render 'rating', rating_value: product.metafields.reviews.rating.value %} {{ rating_count }} {{ 'products.product.reviews_link' | t: count: rating_count }}
{%- endif -%} {%- endif -%}

Hey @StanSavellis code for the first one. please replace it.

{% if section.settings.hide_if_empty == false or section.settings.product_list != blank %}
{%- liquid
if section.settings.enable_carousel == true
assign show_carousel_nav = true

if section.settings.product_list != blank and section.settings.product_list.size <= section.settings.grid
assign show_carousel_nav = false
endif
else
assign show_carousel_nav = false
endif
-%}

{%- if section.settings.title != blank or section.settings.link_text != blank or section.settings.enable_carousel == true -%}

{% if section.settings.title != blank %}
## {{ section.settings.title | escape }}
{% endif %}

{% if section.settings.link_text != blank %}
{{ section.settings.link_text | escape }}
{% endif %}

{% endif %}

{%- if show_carousel_nav -%}

{%- endif -%}

{%- assign grid_class = 'one-quarter' -%}
{%- if section.settings.grid == 2 -%}
{%- assign grid_class = 'one-half' -%}
{%- elsif section.settings.grid == 3 -%}
{%- assign grid_class = 'one-third' -%}
{%- elsif section.settings.grid == 5 -%}
{%- assign grid_class = 'one-fifth' -%}
{%- endif -%}

{%- if section.settings.grid_mobile == "2" -%}
{%- assign mobile_grid_class = 'small-down--one-half' -%}
{%- else -%}
{%- assign mobile_grid_class = 'small-down--one-whole' -%}
{%- endif -%}
{% capture grid_class_list %}{{ grid_class }} {{ mobile_grid_class }} grid-flex__item{% endcapture %}

{% for product in section.settings.product_list %}
{% assign quickbuy_toggle = settings.quickbuy_buttons_toggle %}
{% render 'product-block', quickbuy: quickbuy_toggle, product: product, grid_class: grid_class_list, show_vendor: section.settings.show_vendor %}
{%- else -%}
{%- liquid
if section.settings.enable_carousel == true
assign placeholder_count = 8
else
assign placeholder_count = section.settings.grid
endif
-%}
{% for i in (1..placeholder_count) %}

{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}

{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg placeholder-svg--small' }}

{{ 'homepage.onboarding.product_title' | t }}

{% if product.available %}

{%- if settings.product_currency_code_enabled -%}
{{- 2000 | money_with_currency -}}
{%- else -%}
{{- 2000 | money -}}
{%- endif -%}

{% endif %}

{% endfor %}
{% endfor %}

{%- if show_carousel_nav -%}

{% render 'peek-carousel-advice' %}
{%- endif -%}

{% endif %}

{% schema %}
{
"name": "Product list",
"tag": "section",
"class": "section-product-template-product-list",
"settings": [
{
"type": "text",
"id": "title",
"label": "Heading",
"default": "Product list"
},
{
"type": "checkbox",
"id": "enlarge_title",
"label": "Enlarge heading",
"default": false
},
{
"type": "text",
"id": "link_text",
"label": "Link text",
"default": "Shop now"
},
{
"type": "url",
"id": "link_url",
"label": "Link URL"
},
{
"type": "product_list",
"id": "product_list",
"label": "Product list"
},
{
"type": "checkbox",
"id": "hide_if_empty",
"label": "Hide section if product list is empty",
"info": "Useful when using a dynamic source",
"default": false
},
{
"type": "checkbox",
"id": "show_vendor",
"label": "Show vendor",
"default": false
},
{
"type": "checkbox",
"id": "enable_carousel",
"label": "Enable carousel",
"default": false
},
{
"type": "range",
"id": "grid",
"label": "Desktop products per row",
"min": 2,
"max": 5,
"step": 1,
"default": 4
},
{
"type": "select",
"id": "grid_mobile",
"label": "Mobile products per row",
"options": [
{
"value": "1",
"label": "1"
},
{
"value": "2",
"label": "2"
}
],
"default": "2"
}
],
"presets": [
{
"name": "Product list"
}
],
"enabled_on": {
"templates": [
"product"
]
}
}
{% endschema %}

@StanSavellis code for second one. replace it. EDITED

 0 %} data-cc-animate-delay="{{ animate | times: 0.07 }}s"{% endif %}{% endif %}>

{%- if product.featured_media != blank -%}

{% liquid
if settings.product_grid_image_shape == 'natural'
assign aspect_ratio = false
elsif settings.product_grid_image_shape == 'square'
assign aspect_ratio = 1.0
elsif settings.product_grid_image_shape == 'landscape-32'
assign aspect_ratio = 1.5
elsif settings.product_grid_image_shape == 'landscape-54'
assign aspect_ratio = 1.25
elsif settings.product_grid_image_shape == 'portrait-45'
assign aspect_ratio = 0.8
elsif settings.product_grid_image_shape == 'portrait-23'
assign aspect_ratio = 0.67
endif
%}
{% render 'responsive-image', image: product.featured_media.preview_image, aspect_ratio: aspect_ratio %}

{%- if settings.hover_image_enabled == true and product.media.size > 1 -%}

{%- endif -%}
{%- else -%}
{{- product.featured_media.preview_image | img_url: '600x600' | img_tag -}}
{%- endif -%}

{%- if quickbuy -%}

{{ 'products.quickbuy.quick_buy' | t }}
{% render 'quick-buy-placeholder', product: product %}

{%- endif -%}

{{ product.title }}

{% capture the_snippet_review_avg %}{% render 'ssw-widget-avg-rate-listing', product: product %}{% endcapture %}
{% unless the_snippet_review_avg contains 'Liquid error' %}
{{ the_snippet_review_avg }}
{% endunless %}

{%- if show_vendor -%}

{{- product.vendor -}}

{%- endif -%}

{%- assign cheapest_variant = product.variants | sort: 'price' | first -%}
{% render 'unit-price', variant: cheapest_variant %}

{% if product.available %}
{% if product.price_varies %}
{{ 'products.product.from_text' | t }}
{% endif %}

{%- if settings.product_currency_code_enabled -%}
{{- cheapest_variant.price | money_with_currency -}}
{%- else -%}
{{- cheapest_variant.price | money -}}
{%- endif -%}

{% if cheapest_variant.compare_at_price > cheapest_variant.price %}
{{ 'products.product.regular_price' | t }}
{{ cheapest_variant.compare_at_price | money }}
{% endif %}
{% endif %}

{% if product.available %}
{% if cheapest_variant.compare_at_price > cheapest_variant.price and settings.sale_label_enabled %}
{{ 'products.product.on_sale' | t }}
{% endif %}
{% elsif settings.sold_label_enabled %}
{{ 'products.product.sold_out' | t }}
{% endif %}

{%- if settings.swatch_enabled_grid -%}
{%- liquid
assign swatch_count = 0
assign swatch_mobile_limit = 3
-%}

{%- for product_option in product.options_with_values -%}
{%- liquid
if settings.swatch_enabled_productpage and settings.swatch_option_name contains product_option.name
assign is_swatch = true
else
assign is_swatch = false
endif
-%}
{%- if is_swatch == true -%}
{%- assign product_option_position_0index = product_option.position | minus: 1 -%}
{%- for product_option_value in product_option.values -%}

{%- liquid
assign option_value_variant = false
for variant in product.variants
if variant.options[product_option_position_0index] == product_option_value
assign option_value_variant = variant
break
endif
endfor

if is_swatch and settings.swatch_method == 'image' and option_value_variant.featured_media == blank
continue
endif

assign swatch_count = swatch_count | plus: 1
-%}

{%- endfor -%}
{%- endif -%}
{%- endfor -%}

{%- if settings.swatch_method == 'image' and swatch_count > swatch_mobile_limit -%}
{%- assign remaining = swatch_count | minus: swatch_mobile_limit -%}
{{ 'collections.general.more_swatches' | t: count: remaining }}
{%- endif -%}

{%- endif -%}

{%- if settings.enable_product_reviews_collection and product.metafields.reviews.rating_count != blank -%}
{%- assign rating_count = product.metafields.reviews.rating_count | plus: 0 -%}
{%- if rating_count > 0 -%}

{% render 'rating', rating_value: product.metafields.reviews.rating.value %}

{{ rating_count }} {{ 'products.product.reviews_link' | t: count: rating_count }}

{%- endif -%}
{%- endif -%}

1 Like

The code for the Collections pages seemed to have worked (THANK YOU) but the individual Products pages has not?

Collections:

Products:

Hey @StanSavellis maybe the file is different for the product page. please search for the “product” and then share me a screenshot of filtered files. i’ll let you know to share the code for particular file.

Thanks