Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to know if the 'Shopp' e-commerce plugin can be modified to display radio buttons instead of drop down menus for the product options. I don't need you to tell me how this can be done (though that would certainly be welcome), just if it is possible. I don't want to invest in Shopp unless it is something that has been done before and there is a thread or article on the Shopp board that explains the hack.

EDIT: Seriously, I just need someone w/ access to the Shopp user forums to login and run a quick search for that kind of mod.

share|improve this question
    
Shopop has a pre purchase forum where you can ask this question –  Ash G Oct 20 '10 at 5:08
    
Nope, they don't but thanks for going out of your way to vote that down. They have a pre-purchase support contact, however after contacting them, I was informed that they couldn't comment on hacks and mods to the plugin. –  Thomas Oct 20 '10 at 5:51
    
forums.shopplugin.net I would have thought they would have answered the question. Did you ask whether it was possible, or did you ask how it could be done? If you asked the how question, of course they would't answer as that would defeat the purpose of paid support. –  Ash G Oct 21 '10 at 11:32
    
forums.shopplugin.net is not accessible by people who have yet to purchase the plugin. –  Thomas Oct 21 '10 at 12:55
add comment

2 Answers

up vote 3 down vote accepted

This example highlights the versatility of interface options you can create by using radio inputs to select a product variation rather than the default 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; ?>

Warning
Using this will make it able to add empty products to your cart (if the product has variations)

share|improve this answer
    
Thanks, for the info - I can't wait to try it out. –  Thomas Oct 21 '10 at 10:44
    
It worked flawlessly. It helped me make a quick change for a customer. Thanks Roswell :-) –  Lars Koudal Nov 2 '12 at 15:32
add comment

Not sure how I reply to Roswell. I've updated his loop to help with empty variations

<?php if(shopp('product','has-variations')): ?>
<ul class="variations">
    <?php while(shopp('product','variations')): ?>
        <li>
            <?php if( shopp('product','variation','stock&return=1') > 0 ) : ?>
                <label>
                    <input type="radio" name="products[<?php shopp('product','id'); ?>][price]" value="<?php shopp('product','variation','id'); ?>" />
                    <?php shopp('product','variation','label'); ?>
                </label>
            <?php endif; ?>
        </li>
    <?php endwhile; ?>
</ul>
<?php endif; ?>
share|improve this answer
    
You can submit an edit to his post using the 'edit' link below his post. –  bungeshea Jan 10 '13 at 8:20
1  
@bungeshea & Dean, editing someone else's code depends on some factors, for clarifications if it applies in this case please check: How far can I refactor someone else's code?. –  brasofilo Jan 10 '13 at 10:13
1  
@brasofilo Perhaps this better in a separate answer, after all (it couldn't really fit in a comment). –  bungeshea Jan 10 '13 at 10:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.