Magento -> Modifying Qty entry in cart to radio button for group products

Posted on 2011-10-06
Last Modified: 2013-11-18
We only want customers to be able to select one of the two grouped products we offer and the qty will always be 1.

Modifying the qty text entry to only be a radio button and make them mutually exclusive in catalog/product/view/type/grouped.phtml like this:
<input type="radio" name="super_group[qty]" value="<?php echo $_item->getId() ?>" />

Open in new window

Will it work correctly?
How/where would I determine to set the qty for the selected one to 1.
Question by:EddieShipman
    LVL 26

    Assisted Solution

    Decided to go with a checkbox instead and allow them to change qty of printed items.
      <?php if ($_item->isVirtual()) : ?>
        <input type="checkbox" name="super_group[<?php echo $_item->getId() ?>]" value="1" />
      <?php else: ?>
        <input type="text" name="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
      <?php endif; ?>

    Open in new window

    LVL 12

    Accepted Solution

    Do you still need help?
    LVL 26

    Author Closing Comment

    Nah, I got everything figured out. Was going to delete this but leave it for others. I'll go ahead and award points to you so it stays as PAQ.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Paypal - Payments without paypal pro and no registration. 4 65
    shopping cart 3 40
    Offer an Online Meeting 2 69
    Not able to see segment 10 70
    The aim of this article is to help you solve the error "Cannot insert the value NULL into column 'ShortDescription', table 'albert_store.dbo.Nop_Product'; column does not allow nulls. UPDATE fails." problem and allow you to continue updating your No…
    I recently read an article which suggested that 60% of businesses in the U.S. that process credit card details online in order to accept payment for goods or services were not Payment Card Industry security standards (PCI) compliant. This statement …
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now