How can I edit the Price.Liquid code by collection on my Dawn-themed site?

Solved

How can I edit the Price.Liquid code by collection on my Dawn-themed site?

WEAREBUNCHED
Visitor
3 0 1

Hey there, 

 

I've created my Shopify site on the Dawn theme. bunched.co.nz

We need to have the text 'PER STEM' visible next to the price of our products, as it can become misleading as our photo's show a bunch of flowers. I edited the price.liquid snippet to add this in. Job done (Tick). 

 

However, now we'd like to add a Gift Card product in which 'PER STEM' becomes irrelevant. 

 

So my question is... is there a way to edit the price.liquid by collection? That way I could only have 'PER STEM' for the Hydrangea collection, and without for the Gift Card collection. Or any other solutions? 

 

Thanks so much!

Abbey

 

 

Accepted Solution (1)

OUTSIDEGRID
Shopify Partner
13 3 9

This is an accepted solution.

Hi Abbey from @WEAREBUNCHED ,

 

In the file Snippets > price.liquid test this line of code under {{ money_price }}:

 

{% for collection in product.collections %}
     {%- if collection.title == "Hydrangea" %} {{ '(PRICE PER STEM)' }} {% endif -%}
{% endfor %}

 

Note: Always duplicate your online site in current theme to a draft version in your theme library, avoid doing changes in your live website! Test it in desktop and mobile before going live with it. 

 

I hope this helps! 

All the best, Bruno

 

View solution in original post

Replies 4 (4)

oscprofessional
Shopify Partner
16277 2432 3165

@WEAREBUNCHED ,

Hey, How are you!

I totally understand your query. If you have liquid coding knowledge of Shopify then you have to check the file first for the pages you want to show. I will solve your issue but it is time-consuming task. I need to analyze your store file.

This solution is complete for all screens Desktop, Laptop, and Mobile.
We will test this on all screens and then will deliver this to you.

 

You can directly get connected with me via email, What's App, or Skype.

we can discuss it there.

 

 

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free | OSCP Shipping Discounts App : Free

OUTSIDEGRID
Shopify Partner
13 3 9

This is an accepted solution.

Hi Abbey from @WEAREBUNCHED ,

 

In the file Snippets > price.liquid test this line of code under {{ money_price }}:

 

{% for collection in product.collections %}
     {%- if collection.title == "Hydrangea" %} {{ '(PRICE PER STEM)' }} {% endif -%}
{% endfor %}

 

Note: Always duplicate your online site in current theme to a draft version in your theme library, avoid doing changes in your live website! Test it in desktop and mobile before going live with it. 

 

I hope this helps! 

All the best, Bruno

 

WEAREBUNCHED
Visitor
3 0 1

Thanks so much for your help!! This solved my issue straight away. Really appreciate your time!! 

OUTSIDEGRID
Shopify Partner
13 3 9

Great Abbey! I'm happy to solve this issue for you.

 

I am creating a service to assist entrepreneurs and developers with a blog where you can find solutions, www.outsidegrid.com,  if you have time to check it and give me feedback it would be great!

 

All the best,

Bruno 

hello@outsidegrid.com