Reputation: 722
I created a Variable Tag (added it to my theme files) and I'd like to call it from the Product Description. When I call the tag from another liquid file it works... but when I try to call it from the Product Editor it doesn't work.
How can I call a Variable Tag from the Product/WYSIWYG Editor? Do Variable Tags only work in liquid files?
What I added to the theme file: {% assign favorite_food = 'apples' %}
What I'm trying to use in the Product Description: My favorite food is {{ favorite_food }}.
Upvotes: 1
Views: 996
Reputation: 2096
Yes its possible but little differently.
Change your product description code like this
{{ product.description | replace: '[favorite_food]', 'apples' }}
Now you can use use the shortcode [favorite_food] anywhere in your product description and it will return the value 'apples'.
Just like that you can use product tags or assigned variables with replace string filter.
{{ product.description | replace: '[price]', product.price }}
Hope this helps
Upvotes: 1