Skip to content

Instantly share code, notes, and snippets.

@bennick
Created January 14, 2013 16:27
Show Gist options
  • Save bennick/4531288 to your computer and use it in GitHub Desktop.
Save bennick/4531288 to your computer and use it in GitHub Desktop.
grouped products for lemonstand unique product blog post
<? if ($product->grouped_products->count): ?>
< label style="display:none;" for="product_id"><?= h($product->grouped_menu_label) ?></label>
<select id="product_id" name="product_id" style="display:none;" onchange="$(this).getForm().submit()">
<? foreach ($product->grouped_products as $grouped_product): ?>
<option <?= option_state(post('product_id'), $grouped_product->id) ?>
value="<?= $grouped_product->id ?>">
<?= h($grouped_product->grouped_option_desc) ?>
</option>
<? endforeach ?>
</select>
<? endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment