Enable collection condition

Estimated reading: 2 minutes 192 views

To hide the product price on the collection page, you need  to enable the Collection conditions. 

The required step is to create a new file in your theme to enable this condition.

Steps to manage

 1.  From Shopify admin page > click Themes > click Edit code 

 2. Under the Template folder, create a new file with the Search template

3. Create a new liquid file > enter name rfq. So the full file name will be search.rfq.liquid

 4. Copy the codes below and paste into search.rfq.liquid file

{%- layout none -%}
{%- if search.terms contains 'handles:' -%}
[
{%- assign params = canonical_url | url_decode | split: "?" | last | split: "&" -%}
{%- assign handles = '' -%}
{%- for str in params -%}
{%- assign str_split = str | split: "=" -%}
{%- if str_split.first == 'q' -%}
{%- assign handles = str_split.last | remove_first: "handles:" -%}
{%- endif -%}
{%- endfor -%}
{%- if handles != '' -%}
{%- assign handles = handles | split: "|" -%}
{%- for handle in handles limit:20 -%}
{%- assign product = all_products[handle] -%}
{%- unless forloop.first -%},{%- endunless -%}
{%- if product.id != '' -%}
{
"available": {{product.available}},
"id": {{ product.id }},
"handle": "{{ product.handle }}",
"options": {{ product.options | json }},
"variants": {{ product.variants | json }},
"price": {{ product.price }},
"tags": {{ product.tags | json }},
"title": {{ product.title | json }},
"type": {{ product.type | json }},
"url": "{{ product.url }}",
"vendor": {{ product.vendor | json }},
"featured_image": "{{ product.featured_image.src | image_url }}",
"images": {{ product.images | json }},
"collection": {{ product.collections | map: 'id' | json }} }
{%- else -%}
null
{%- endif -%}
{%- endfor -%}
{%- endif -%}
]
{%- endif -%}

 5. Click Save to finish creating this new file

 6. IMPORTANT step: Go back to the B2B Request a Quote,Hide Price app, open the Theme Setup section so the latest codes are being pushed to the theme/app data.

Leave a Comment

CONTENTS