Liquid, JavaScript, themes, sales channels
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
Hi
Now that 'include' is legacy, what's the correct way to make variable accessible?
I've got a complicated snippet, which essentially created a handful of variables. It's used about 20 times in the theme, so I'd like to avoid having 20 copies of it.
Something like:
{% liquid if product.handle contains foo
assign var1 = 1
assign var2 = 2
...
I'd use it like this:
{% include 'snippet' %}
{{ var1 }}
That doesn't work with 'render', and I can't find a mention of a way to do it correctly.
Would anyone be able to point me in the right direction?
Many thanks!
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