Skip to content

Instantly share code, notes, and snippets.

View husseyexplores's full-sized avatar
🐾
/ᐠ .ᆺ. ᐟ\ノ ( ̿–ᆺ ̿–)ノ

Hassan Usman husseyexplores

🐾
/ᐠ .ᆺ. ᐟ\ノ ( ̿–ᆺ ̿–)ノ
View GitHub Profile
@zakhardage
zakhardage / Much much simpler option selector for Shopify
Last active July 13, 2024 21:36
Much simpler version of Shopify's option_selection.js for separating product options into their own dropdown menus.
<form action="/cart/add" method="post">
{% if product.variants.size > 1 %}
{% if product.options[0] %}
{% assign used = '' %}
<label for="select-one">{{ product.options[0] }}</label>
<select id='select-one' onchange="letsDoThis()">
{% for variant in product.variants %}
{% unless used contains variant.option1 %}
<option value="{{ variant.option1 }}">{{ variant.option1 }}</option>
{% capture used %}{{ used }} {{ variant.option1 }}{% endcapture %}