I just recieved a notice from Miele that I must comply with California’s Prop65 by 9/31 for any vacuum sold online. Im a bit confused on how to achieve this. Im using the Empire theme. I think I need to edit cart-item.liquid.
Vendor: Miele
Product Type’s: Canister Vacuums, Upright Vacuums
Basically if a customer adds a product that has the above attributes I need to display a generic warning with link on the shopping cart. So far I edited cart-item.liquid file and was able to add some text to the cart. It looked horrible though lol. I suppose after I get text to appear for just Miele canister and upright vacuums I can deal with CSS and try to get it to look better. Any tips would be greatly appreciated. Im off to watch some liquid tutorials…
- Forgot to mention this warning only needs to apply to CA residents.
Edit: I have created a collection called “Prop65” and placed all products that require warning there.
{% for product in collections.Prop65.products %}
Warning
{% endfor %}
Obviously after trying that I realized the stupidity in it lol. for every product in the collection I recieved a warning on each cart item.
Next I tried what you see below. I tried with both Prop65 and prop65 and it didnt seem to work.
{% if product.collections contains 'prop65' %}
Warning! this is my stupid warning that isnt working!
{% endif %}
Update: I have finally been able to get the warning message to appear on items in prop65 collection, using the below code. Now I need to figure out how to only show it to CA users.
{% for collection in item.product.collections %}
{% if collection.handle == "prop65" %}
Warning: Generic warning goes here
{% endif %}
{% endfor %}
The above ended up not working so well after several tests with mutiple products. Below I have added the latet solution I decided to go with. This post is getting long.
Were you able to figure out how to display to just CA users?
Not just yet. I have actually changed a lot since the original post and just keep forgetting to update. I am now currently checking for a product tag rather than a collection. I had some issues with the above code as well that was causing several warnings to appear.
Inside my cart-item is:
{% comment %} Prop 65 warning {% endcomment %}
{% if item.product.tags contains 'prop65' %}
<p class="prop65-warning">CA Warning: Cancer or Reproductive Harm <a href="[https://www.p65warnings.ca.gov](https://www.p65warnings.ca.gov)" target='blank'>Prop65</a></p>
{% endif %}
My theme also has a banner that pops up when the user adds an item to the cart. Once I identified the banner I was able to add some code inside there to also display the warning. I did this because the banner has a checkout button, if user click the checkout they bypass the cart altogether and miss the warning.
{% comment %} Prop 65 warning {% endcomment %}
{% if product.tags contains 'prop65' %}
<p class="prop65-warning">CA Warning: Cancer or Reproductive Harm <a href="[https://www.p65warnings.ca.gov](https://www.p65warnings.ca.gov)" target='blank'>Prop65</a></p>
{% endif %}
I have added the “CA Warning:” to both messages until I get the geo location part figured out. The above code works for any product that contains the product tag ‘prop65’. The code in my first post was actually checking a collection. This way is much better I think. Taking a 10 minute break then going to try to tackle Geo location. Have any ideas?
Hi CarmelVacum,
Thank you for sharing this. I have the same Prop 65 requirement and was struggling to find a solution.
I am using the same theme as you. I am in a completely different industry than you..
Could you please let me know where to put the code in the cart and add to cart banner?
If you get the geo-targeting to work I would love to know how you did it.
Thank you
Yea, definitely! Sorry for the late reply. During the days im in the shop performing repairs and service. The two files I edited for the empire theme was the cart-item.liquid and the atc-banner.liquid(I think). Soon as I get back into my office with my personal computer I’ll let you know. I was doing more testing with the above code and I think it might need another tweak. It seems if I add a product to the cart from the collection page using the quick add button the warning isnt triggering for the cart banner. I think this is due to not being on the actual product page when clicking add to cart. I’ll be at the house in a few hours and will be looking at all this again. I will show you each file I changed and where to paste the code in. Geolocation is taking me a bit longer to figure out.
Sorry for the late reply. Ive been crazy busy. Below you can see what files I edited, where I edited, and what I added. Im not happy with the results. Im a noob when it comes to liquid and how shopify is set up.
Empire Theme Files: cart-item.liquid, atc-banner.liquid, theme.scss.liquid
Problem still with the code: The cart banner code only works if user adds product to cart from product page. If they use quick add from collection view it doesnt work.
Solutions: 1; turn on cart redirection so users hit message in cart-tiems.liquid. 2; disable quick add buttons (I think this can be done). 3; add additional block of code to run through products on the collection page to check if the product has the tag. This way if they are on collection or product page it would check and display warning on the cart banner. I like the third option but its just a theory. I need to read up more on shopify themeing and liquid.
cart-item.liquid code; I added this below on line 51.
{% comment %} Prop 65 warning {% endcomment %}
{% if item.product.tags contains 'prop65' %}
<p class="prop65-warning">CA Warning: Cancer or Reproductive Harm <a href="[https://www.p65warnings.ca.gov](https://www.p65warnings.ca.gov)" target='blank'>Prop65</a></p>
{% endif %}
atc-banner.liquid code; I added this below on line 2. (this one was between two tags in theme)
{% comment %} Prop 65 warning {% endcomment %}
{% if product.tags contains 'prop65' %}
<p class="prop65-warning">CA Warning: Cancer or Reproductive Harm <a href="[https://www.p65warnings.ca.gov](https://www.p65warnings.ca.gov)" target='blank'>Prop65</a></p>
{% endif %}
theme.scss.liquid code; add this anywhere. bottom or near top.
//prop65 warning
p.prop65-warning {
font-size: 7pt
}
Keep in mind depending on your theme version your code might be different. I bought this theme a year ago and there has been one update that I did already. I will be trying to imporve this all so I will definitely post updates as I get them.
Added a photo below showing the shopping cart. I didnt want to add one of the banner yet as it is only currently working when the user is adding from product page.
Thanks CarmelVacum.
I might chck with a developer to see about getting the geo-targeting set up.
I’ll let you know what I learn.
I would greatly appreciate it. I will update here as well as I learn more!
Hey Kevin, did you solve this? I just found this free app https://apps.shopify.com/product-warnings
It appears that we can target from area and pop messages. Im going to take a look tonight but I think this will be the quickest and easiest solution to our problem.
edit: I couldnt help myself.. I just took a quick look at the app its definitely what we need!
Hi Carmel, I had seen that app before but choose not to use it.
TaskHusky is adding custom code to my site to display the warning message at the bottom of the product page. The code will only show on tagged products when the shopper is in CA. I am having the same warning added to my packing slips too. Thier pricing is reasonable.
I will let you know how it works out once they are done.
Hi Carmel,
The programing is done on my site to show the warning message only to California shopper. If you are in California you can see it here at the bottom of the product description.
https://supplementfirst.com/products/advanced-naturals-fibermax-caps
If you are in CA and don’t mind, could you please let me know that you saw the warning message on my site? It would be good to have real confirmation that it is really working correctly.
I have another store that uses the same template you have. This update will be made to that store next.
Thanks
Does Shopify have any Apps or custom coding to show a P65 warning only to CA shoppers?
Prop65 also requires a second warning in the checkout, this is only possible with Shopify Plus? So have to pay $2000 a month for a warning based on shipping address?
I found this on Google:
Who is exempt from Prop 65?
Are any businesses exempt from Proposition 65’s requirements? Businesses with less than 10 employees and government agencies are exempt from Proposition 65’s warning requirements and prohibition on discharges into drinking water sources.
@CarmelVacuum , did the app work? Or, did you find another solution?
We ended up adding the Prop65 to all products requiring it.