Skip to content

Instantly share code, notes, and snippets.

@mrowa44
Created January 27, 2022 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrowa44/2a733e8262820cb5fe41eb7195939657 to your computer and use it in GitHub Desktop.
Save mrowa44/2a733e8262820cb5fe41eb7195939657 to your computer and use it in GitHub Desktop.
{% if bundle.published %}
<div class="sections">
{% assign section = bundle.current_section %}
{% if bundle.sections.size > 0 %}
<div class="section">
<h1>{{ section.name }}</h1>
<p class="section__description">{{section.description}}</p>
<div class="product-box">
{% if section.products %}
{% for product in section.products %}
{% add_to_bundle_form section %}
<div class="product" id="{{product.variants[0].id}}">
<img src="{{ product.image.src }}" />
<h4>{{ product.title }}</h4>
<p class="product__price">{{product.available_variants[0].price | money}}</p>
{% if product.available_variants.size > 1 %}
<select name="variant" id="select-{{ section.index }}-{{ product.id }}">
{% for variant in product.available_variants %}
<option value="{{ variant.id }}" data-price={{ variant.price | money }}>
{{ variant.title }}{% if variant.available_count %} (available: {{ variant.available_count }}){% endif %}
</option>
{% endfor %}
</select>
{% else %}
<input type="hidden" name="variant" value="{{ product.available_variants[0].id }}" />
{% endif %}
<button type="submit" class="button button--secondary">Dodaj</button>
</div>
{% end_add_to_bundle_form %}
{% endif %}
</div>
</div>
{% endif %}
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment