Message on the cart page based on number of items - is this possible?

Solved
sbar
Excursionist
21 0 9

Hi!! I am trying to add a message to the cart page, but it requires knowing conditions/control flow. I'm somewhat familiar with this and I know how to code some front-end stuff, but can't figure out why nothing I try is working. The site is selling socks and will be donating $1 per pair sold, so the cart must generate a message based on the number of pairs in the cart!

For example, the message is "$X being donated to a great cause!"

If it sells 1 pair of socks it should show $1, if he sells 2 pairs the message should show $2, etc. I believe it just requires some code on the cart page, which shouldn't be hard. Using the Pipeline theme - 

Any input on this? Would appreciate any help!!

0 Likes
MandasaTech
Shopify Expert
39 4 10

This is an accepted solution.

You can print this message using:


"${{ cart.item_count }} being donated to a great cause!"

Want to modify or custom changes on store for affordable price?
Hire us - https://experts.shopify.com/mandasa-technologies
Website: http://www.mandasa.in/
Email: info@mandasa.in
If helpful then please Like and Accept Solution.
sbar
Excursionist
21 0 9

That is SO much easier than I thought, THANK YOU!!