Liquid, JavaScript, themes, sales channels
Hello, been searching everywhere for an answer but i got nothing.
{{ product.description | replace: 'THISWORD', 'this' }}
Im trying to replace THISWORD with this, but i want this to be an image.
How can i do this in code?
Solved! Go to the solution
This is an accepted solution.
The error was that you can't reuse parentheses inside {{ }}.
Try the code below:
{% assign image = product.images[1] | img_url: 'large' %}
{% if product.media.size > 1 %}
{% capture image_html %}
<img src="{{ image }}" alt="{{ product.featured_image.alt | escape }}">
{% endcapture %}
{{ product_description | replace: 'Como Usar?', image_html }}
{% endif %}
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024