This example highlights the versatility of interface options you can create by using radio inputs to select a product variation rather than the default <select> menus. This section of code could be used in place of the variations code block in either the product.php template file or the category.php template file (if you want variation…

Product Variations as Radio Inputs

Product Variations as Radio Inputs

This example highlights the versatility of interface options you can create by using radio inputs to select a product variation rather than the default <select> menus.

This section of code could be used in place of the variations code block in either the product.php template file or the category.php template file (if you want variation inputs in your category products list).

<?php if(shopp('product','has-variations')): ?>


<ul class="variations">
    <?php while(shopp('product','variations')): ?>
        <li>
            <label>
            <input type="radio" name="products[<?php shopp('product','id'); ?>][price]" value="<?php shopp('product','variation','id'); ?>" />
            <?php shopp('product','variation','label'); ?>
            </label>
        </li>
    <?php endwhile; ?>
</ul>


<?php endif; ?>

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar