Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Hide Product Price on Taste theme

Solved

Hide Product Price on Taste theme

chelseanguyen
Tourist
5 0 1

Hi team,

 

I am trying to hide the price of Product when the Product Type is "XYZ" but couldn't figure out how to do this.

I'm using the Taste theme. The website is not live yet, so I can't share a link.

 

Could someone please help.

 

Thank you,

Chesea

Accepted Solution (1)
pawankumar
Shopify Partner
627 93 115

This is an accepted solution.

To hide it on collection pages
in file snippets/card-product.liquid
Search for 

{% render 'price', product: card_product, price_class: '' %}

and replace it with

 {% if template contains "collection" %}
            {% unless card_product.type == "XYZ" %}
            {% render 'price', product: card_product, price_class: '' %}
            {% endunless %}  
            {% else %}   
            {% render 'price', product: card_product, price_class: '' %}
            {% endif %}

 Thanks

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan

View solution in original post

Replies 10 (10)

ZestardTech
Shopify Partner
5902 1066 1412

Hello There,

Please share your store URL and password.
So that I will check and let you know the exact solution here.

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing
chelseanguyen
Tourist
5 0 1

Hi ZestardTech,

 

Sorry I don't think I'm being clear in my question.

I wanted to hide the Product price on the Collection Page when the Product Type is XYZ.

 

Here is the URL of the collection page: https://inspireddiy.myshopify.com/collections/inspiration-staircases

The password is: cheing

 

Thank you,

Chelsea

pawankumar
Shopify Partner
627 93 115

In file sections/main-product.liquid
Search for ' {%- when 'price' -%}'
and 
replace

              <div class="no-js-hidden" id="price-{{ section.id }}" role="status" {{ block.shopify_attributes }}>
                {%- render 'price', product: product, use_variant: true, show_badges: true, price_class: 'price--large' -%}
              </div>

to

              {% unless product.type == "XYZ" %}
              <div class="no-js-hidden" id="price-{{ section.id }}" role="status" {{ block.shopify_attributes }}>
                {%- render 'price', product: product, use_variant: true, show_badges: true, price_class: 'price--large' -%}
              </div>
               {% endunless %} 
- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
chelseanguyen
Tourist
5 0 1

Hi Pawankumar,

 

Thank you for the reply. I managed to find the exact section you mentioned and made the changes but it didn't work. The price is still showing for product types that are "XYZ".

Is there anything else I could do.

 

Thank you,

Chelsea

 

pawankumar
Shopify Partner
627 93 115

Can you please share product url with product type "XYZ" ( with password if your store password is enabled )?
Thanks!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
chelseanguyen
Tourist
5 0 1

Hi Pawankumar,

 

Sorry I don't think I'm being clear in my question.

I wanted to hide the Product price on the Collection Page when the Product Type is XYZ.

 

Here is the URL of the collection page: https://inspireddiy.myshopify.com/collections/inspiration-staircases

The password is: cheing

 

Thank you,

Chelsea

pawankumar
Shopify Partner
627 93 115

This is an accepted solution.

To hide it on collection pages
in file snippets/card-product.liquid
Search for 

{% render 'price', product: card_product, price_class: '' %}

and replace it with

 {% if template contains "collection" %}
            {% unless card_product.type == "XYZ" %}
            {% render 'price', product: card_product, price_class: '' %}
            {% endunless %}  
            {% else %}   
            {% render 'price', product: card_product, price_class: '' %}
            {% endif %}

 Thanks

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
chelseanguyen
Tourist
5 0 1

Thanks so much Pawankumar. That works.

Swm24
Visitor
1 0 0

Hello Pawankumar, I have similar query, I want prices for all products in Coming soon, Collections, and featured to be displayed only for customers who are logged in, can Ass to cart be enabled only for logged in customer, I am using Taste theme, can you pls guide

pawankumar
Shopify Partner
627 93 115

Hi @Swm24 

You can use the below idea for specific collection and logged in customer

{%- if template contains "collection" and collection.handle == "your-handle-here" -%}
Your collection specific code here
{%- endif -%}

{%- if customer -%}
This code will appear only for logged in customer
{%- endif -%}


To make actual implementation, you will require liquid knowledge, You can apply the above idea if you are looking for something like this
Thanks!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan