Skip to content

Instantly share code, notes, and snippets.

@liamgriffin
Created December 16, 2021 12:16
Show Gist options
  • Save liamgriffin/f1d32dafabb2320357f6016150c33454 to your computer and use it in GitHub Desktop.
Save liamgriffin/f1d32dafabb2320357f6016150c33454 to your computer and use it in GitHub Desktop.
How to Test your Theme Before Submitting to the Shopify Theme Store | Selling Plan
{% if product.selling_plan_groups.size > 0 %}
<div>
<label for="plans">Purchase options:</label>
<select name="selling_plan" id="plans">
<option value="">One time purchase</option>
{% for variant in product.variants %}
<optgroup label="{{ variant.title }}">
{% for allocation in variant.selling_plan_allocations %}
<option value="{{ allocation.selling_plan.id }}">
{{ allocation.selling_plan.name }}
</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment