[Last Call] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2011-10-06
Medium Priority
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:Eddie Shipman
  • 2
LVL 26

Assisted Solution

by:Eddie Shipman
Eddie Shipman earned 0 total points
ID: 36927319
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

miked2004 earned 2000 total points
ID: 36930959
Do you still need help?
LVL 26

Author Closing Comment

by:Eddie Shipman
ID: 36954302
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often people are aiming at development of perfect Magento websites. Though, it is easier said than done. You know what’s much easier? To ruin everything. It can be done in seconds. Many of us experimented with design, tried to change some values dir…
E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

829 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