Hide prices of sold out products on product page for EDITION THEME :)

Hello!

How do i hide prices of sold out products on product page for EDITION THEME :)\

Thank u very much!!

@mrjoephua if sold product has unique class or id then using css it can be done, else it will need code editing, can you please share this page link?

Hi @mrjoephua ,

Please send me the code of card-product.liquid file, I will check it for you

Hello!

https://orangeporter.com/collections/all

Hello!, i dont have card-produdct.liquid file. I have product-form-price.liquid

Not sure if it helps :slightly_smiling_face:

{% comment %}
@param_1 product {Product}

@param_1 variant {Variant}

@param_1 form {ProductForm}

@param_1 class {String}
{% endcomment %}

{% if product != blank %} {{ variant.price | money }} {% else %} {{ 1999 | money }} {% endif %}

<s
class="
product-price__compare
money
{% if product.compare_at_price_min <= variant.price %}
product-price__compare–hidden
{% endif %}
"
data-product-price-compare

{% if variant.compare_at_price > variant.price %}
{{ variant.compare_at_price | money }}
{% endif %}

{% capture total_quantity %}{{ variant.unit_price_measurement.quantity_value }}{{ variant.unit_price_measurement.quantity_unit }}{% endcapture %}
{% capture unit_price %}{{ variant.unit_price | money }}{% endcapture %}
{% capture unit_measure %}{%- if variant.unit_price_measurement.reference_value != 1 -%}{{ variant.unit_price_measurement.reference_value }}{%- endif %}{{ variant.unit_price_measurement.reference_unit }}{% endcapture %}

{{ 'product.unit_pricing.price_per_unit_html' | t: total_quantity: total_quantity, unit_price: unit_price, unit_measure: unit_measure | strip_newlines }}

{%- capture tax_text -%}
{{ ‘product.phrases.tax_line_html’ | t }}
{%- endcapture -%}

{%- if tax_text != blank -%}

{{ tax_text }}
{%- endif -%}
{{ form | payment_terms }}

Hi @mrjoephua ,

Please add code here:

Code:


Hello! Thank u! Its hidden from product details page. Would u know also how to hide from product category page?

Thank u so muchhhhh!!!

Hi @mrjoephua ,

Please send me the code of card-product.liquid file, I will check and guide it for you

Hello!, i dont have card-produdct.liquid file. I have product-form-price.liquid

I have product.liquid

{% comment %}
@param_1 product
@param_1 variant
@param_1 enable_zooom
{% endcomment %}

{% assign gallery_block = section.blocks | where: ‘type’, ‘gallery’ | first %}
{% assign layout = gallery_block.settings.position | default: ‘one-column’ %}

{% assign is_quickshop = is_quickshop | default: false %}
{% if is_quickshop and gallery_block != blank %}
{% assign layout = ‘two-column’ %}
{% endif %}

{% if layout == 'two-column' %} {% render 'product-gallery', product: product, layout: layout, enable_zoom: enable_zoom, onboarding: onboarding block: gallery_block, %} {% endif %} {% if product != blank %} {% form 'product', product, class: 'product-details', data-product-form: "" %} {% render 'product-contents', product: product, variant: variant, form: form, layout: layout, section: section, show_payment_button: show_payment_button, is_quickshop: is_quickshop, %} {% endform %} {% else %}
{% render 'product-contents', section: section, layout: layout, onboarding: true, show_payment_button: show_payment_button, %}
{% endif %}

I also have product-contents.liquid

{% comment %}
@param_1 product {Product}

@param_1 variant {Variant}

@param_1 form {ProductForm}

@param_1 section {Section}

@param_1 layout {String}
One of one-column or two-column

@param_1 show_payment_button {Boolean}
Renders the DPBs

@param_1 is_quickshop {Boolean}
Link title to product page
{% endcomment %}

{% comment %}Dynamic checkout is not shown if selling plans are available{% endcomment %}
{% if product.selling_plan_groups.size > 0 %}
{% assign show_payment_button = false %}
{% endif %}

{% assign rendered_quantity_selector = false %}
{% assign rendered_variant_selection = false %}

{% assign has_price_and_quantity_block = false %}
{% assign price_and_quantity_block_count = section.blocks | where: ‘type’, ‘price_and_quantity’ | size %}
{% if price_and_quantity_block_count > 0 %}
{% assign has_price_and_quantity_block = true %}
{% endif %}

{% assign first_block_class = ‘product-block–first’ %}

{% for block in section.blocks %}
{% case block.type %}
{% when ‘@app’ %}

{% render block %}
{% when 'title' %} {% assign heading_element = 'h2' %} {% if template.name == 'product' %} {% assign heading_element = 'h1' %} {% endif %}

<{{ heading_element }}
class=“product__heading {{ first_block_class }}”
{{ block.shopify_attributes }}

{% if is_quickshop %}{% endif %}
{% if onboarding %}
{{ ‘product.onboarding.title’ | t }}
{% else %}
{{ product.title }}
{% endif %}
{% if is_quickshop %}
{% endif %}
</{{ heading_element }}>
{% when ‘vendor’ %}

{% if onboarding %} {{ 'product.onboarding.vendor' | t }} {% else %} {{ product.vendor | link_to_vendor }} {% endif %}

{% when 'variant_selection' %} {% if onboarding %} {% continue %} {% endif %}

{%
render ‘product-options-dropdown’,
product: product,
block: block,
class: first_block_class,
%}
{% assign rendered_variant_selection = true %}
{% when ‘price’ %}
{% if has_price_and_quantity_block %}
{% continue %}
{% endif %}
{%
render ‘product-form-price’,
product: product,
variant: variant,
form: form,
class: first_block_class,
%}
{% when ‘quantity’ %}
{% if has_price_and_quantity_block %}
{% continue %}
{% endif %}
{%
render ‘product-form-quantity’,
class: first_block_class,
%}
{% assign rendered_quantity_selector = true %}
{% when ‘price_and_quantity’ %}

{% render 'product-form-price', product: product, variant: variant, form: form, %} {% render 'product-form-quantity' %} {% assign rendered_quantity_selector = true %}
{% when 'text' %}
{{ block.settings.text }}
{% when 'description' %} {% if product.description != blank or onboarding %}
{% if onboarding %} {{ 'product.onboarding.description' | t }} {% else %} {{ product.description }} {% endif %}
{% endif %} {% when 'form' %}
{%- if variant.available -%} {{ 'product.add_to_cart.submit' | t }} {% else %} {{ 'product.add_to_cart.sold_out' | t }} {% endif %} {% render 'icon-library', id: 'icon-spinner' %} {% if show_payment_button %} {{ form | payment_button }} {% endif %}
{% when 'share' %}

{{ 'general.social.share_this' | t }}

{% render 'share-buttons', context: product %}
{% when 'gallery' %} {% if layout == 'two-column' %} {% continue %} {% endif %} {% capture gallery_classes %} {{ first_block_class }} {% if forloop.last %}product-gallery--last{% endif %} {% endcapture %} {% render 'product-gallery', product: product, layout: layout, enable_zoom: enable_zoom, onboarding: onboarding, class: gallery_classes, block: block, %} {% when 'rating' %} {%- if product.metafields.reviews.rating.value != blank -%}
{% render 'rating-stars', value: product.metafields.reviews.rating.value.rating, scale_max: product.metafields.reviews.rating.value.scale_max, %}

{{ product.metafields.reviews.rating.value }} / {{ product.metafields.reviews.rating.value.scale_max }}

({{ product.metafields.reviews.rating_count }}) {{ product.metafields.reviews.rating_count }} {{ "general.accessibility.total_reviews" | t }}

{%- endif -%} {% endcase %} {% assign first_block_class = '' %} {% endfor %}

{% unless rendered_quantity_selector %}

{% endunless %}

{% unless rendered_variant_selection %}
<input
name=“id”
value=“{{ product.selected_or_first_available_variant.id }}”
type=“hidden”

{% endunless %}

Hi @mrjoephua ,

It doesn’t seem like these files, can I send you a collaborator invite? it will help me find the file and add code to it

sure!!

Hi @mrjoephua ,

Please send me the collaborator code in private message, I will send you the invitation and check it

sent!

Hi @mrjoephua ,

Please go to small-product-item.liquid file and add code here: