Ad

Show Product Options Like Flavors Below Each Product

- 1 answer

I am new to shopify and I am looking for any help. I am using the Simple shopify theme and in settings page I displayed my products in Homepage. Now homepage contains product images with prices. What I want to add is the product flavors. I wanted to display each product available below each product located in homepage but don't know where to tweak it. Any help would be much appreciated.

index.liquid

{% if settings.home_section_1 != blank %}
  {% include settings.home_section_1 %}
{% endif %}
Ad

Answer

You can do this using product options and by tweaking your index.liquid file like this:

<ul>
{% for product in products limit:10 %}
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="{{ product.url}}"><img src="{{ product.featured_image | product_img_url: 'medium' }}" alt=""></a>

    <div>Flavors available:</div>
    <ul>
    {% for option in product.options_with_values %}
        <li>{{ option.name }} : {{ option.values | join ', ' }}</li>
    {% endfor %}
    </ul>
    </li>
{% endfor %}
</ul>

In your case, you might have to edit the template liquid file in /Snippets selected for home_section_1 according to your settings_schema.json

Ad
source: stackoverflow.com
Ad