Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This snippet is intended for use in a product.php template
- * in the context of Shopp 1.1.9.
- *
- * Creates radio buttons to allow product variations to be
- * selected. Pricing information per-variation is deliberately
- * omitted.
- */
- $i = 1;
- while (shopp('product', 'variations'))
- {
- // Form the radio button name
- $id = shopp('product', 'id', 'return=true');
- $name = "products[$id][options][]";
- // The first field should be selected by default
- $selected = ($i == 1) ? 'checked="checked"' : '';
- // Echo to screen
- echo '<input type="radio" name="'.$name.'" value="'.$i.'" '.$selected.' />';
- shopp('product', 'variation', 'label');
- // Increment
- $i++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement