Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Add product position (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanPJF authored Apr 7, 2017
1 parent 7c988ad commit 7e7e601
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/sections/featured-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">

<form action="/cart/add" method="post" enctype="multipart/form-data">
{% unless product.options.size == 1 and product.variants[0].title == 'Default Title' %}
{% unless product.variants.size == 1 and product.options.size == 1 and product.options.first == 'Title' and product.variants.first.title == 'Default Title' %}
{% for option in product.options_with_values %}
<div class="selector-wrapper js">
<label
Expand All @@ -52,7 +52,7 @@
<select
id="SingleOptionSelector-{{ section.id }}-{{ forloop.index0 }}"
data-single-option-selector
data-index="option{{ forloop.index }}">
data-index="option{{ option.position }}">
{% for value in option.values %}
<option
value="{{ value | escape }}"
Expand Down
4 changes: 2 additions & 2 deletions src/sections/product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<link itemprop="availability" href="http://schema.org/{% if current_variant.available %}InStock{% else %}OutOfStock{% endif %}">

<form action="/cart/add" method="post" enctype="multipart/form-data">
{% unless product.options.size == 1 and product.variants[0].title == 'Default Title' %}
{% unless product.variants.size == 1 and product.options.size == 1 and product.options.first == 'Title' and product.variants.first.title == 'Default Title' %}
{% for option in product.options_with_values %}
<div class="selector-wrapper js">
<label
Expand All @@ -44,7 +44,7 @@
<select
id="SingleOptionSelector-{{ forloop.index0 }}"
data-single-option-selector
data-index="option{{ forloop.index }}">
data-index="option{{ option.position }}">
{% for value in option.values %}
<option
value="{{ value | escape }}"
Expand Down

0 comments on commit 7e7e601

Please sign in to comment.