Follow

Insert Liquid code into collection page (to show gifts on catalog page)

Normally it will be a file in the Snipsets folder, for example: product-loop.liquid, product-grid-list.liquid or even collection.liquid.

Find the code that shows the image. It looks like.

<img src="{{ product.featured_image | product_img_url: 'large' }}" alt="{{ product.title | escape }}" />

Then add this code below:

<div id="secomapp-fg-image-{{ product.id }}" style="display: none;"> {{ "icon-freegift.png" | asset_url | img_tag: "Free Gift", "sca-fg-img-label" }} </div>

Add this code before or after details tag (<div class="details">)

{% if product.metafields.secomapp.freegift %} <div class="sca-fg-cat-list" style="display:none;" id="secomapp-fg-data-{{ product.id }}" name="sca.fg.product" data='{{ product.metafields.secomapp.freegift }}' settings='{{ shop.metafields.secomapp.freegift_settings }}' prod-show='list'> </div> {% endif %}
 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk