Shopify themes, liquid, logos, and UX
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
Apologies I'm very new to liquid/coding and I've googled as much as I can and can't find an answer. I'm looking to add text to my homepage that pulls the price of a product into the text of a homepage. I'd like a paragraph of text to say something like this:
"with 100 blades costing only [price of specific product] you are set for two plus years" (again this is not on the product page. but on a separate page, calling the price up of a specific product)
bonus points if I can also do math like [price of product / 2]
the idea is i have text for a page change based on the user, so it will display whatever price they're currently set to see. eg: canadians will CAD, americans will see USD. (but ideally not have the currency code)
I'm sure this is extremely simple, I'm just struggling to find an answer.
Thank you.
Solved! Go to the solution
This is an accepted solution.
figured it out. I was just messing up the product handle when trying to assign a product to a variable, so I had found the solution earlier, just messed up implementation. I knew it had to be simple.
{% assign content_price = all_products['asdf-asdf'] %} (the product handle is the name of the product in the URL eg:/products/asdf-asdf the handle is asdf-asdf
{{ content_price.title }} is {{ content_price.price | divided_by: 100 | money }}
result:
Asdf Asdf is $0.10
This is an accepted solution.
figured it out. I was just messing up the product handle when trying to assign a product to a variable, so I had found the solution earlier, just messed up implementation. I knew it had to be simple.
{% assign content_price = all_products['asdf-asdf'] %} (the product handle is the name of the product in the URL eg:/products/asdf-asdf the handle is asdf-asdf
{{ content_price.title }} is {{ content_price.price | divided_by: 100 | money }}
result:
Asdf Asdf is $0.10
User | RANK |
---|---|
113 | |
88 | |
70 | |
68 | |
45 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022