Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can magento display grouped product variants as a dropbox? 
 
mattramage
Jr. Member
 
Total Posts:  24
Joined:  2009-01-21
 

Can magento display grouped product variants as a dropbox with the qty box next to it as opposed to the table view with multiple qty boxes?

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

You can easily make it that way. As you say, it now renders it in a table. Just change the HTML and it’ll render in whatever form you want it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mattramage
Jr. Member
 
Total Posts:  24
Joined:  2009-01-21
 

Where exactly would i find the html for that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mattramage
Jr. Member
 
Total Posts:  24
Joined:  2009-01-21
 

I believe it’s here in the group.phtml file but I don’t even know where to start with converting this to a dropmenu. Any suggestions would be greatly appreciated.

<?php $_product = $this->getProduct() ?>
<?php $_associatedProducts = $this->getAssociatedProducts() ?>
<?php if($_product->isSaleable() && count($_associatedProducts)): ?>
<p class="availability"><?php echo $this->__('Availability') ?>: <span class="in-stock"><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
<p class="availability"><?php echo $this->__('Availability') ?>: <span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>

<table class="data-table grouped-items” id="super-product-table">
<col />
<col />
<col width="1" />
<thead>
<tr>
<th><?php echo $this->__('Product Name') ?></th>
<th class="a-right"><?php echo $this->__('Price') ?></th>
<?php if ($_product->isSaleable()): ?>
<th class="a-center"><?php echo $this->__('Qty') ?></th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php if (count($_associatedProducts)): ?>
<?php foreach ($_associatedProducts as $_item): ?>
<tr>
<td><?php echo $this->htmlEscape($_item->getName()) ?></td>
<td class="a-right">
<?php echo $this->getPriceHtml($_item, true) ?>
</td>
<?php if ($_product->isSaleable()): ?>
<td class="a-center">
<?php if ($_item->isSaleable()) : ?>


<input name="super_group[<?php echo $_item->getId() ?>]” value="1" type="hidden" class="input-text qty” />
<?php else: ?>
<p class="availability"><span class="out-of-stock"><?php echo $this->__('Out of stock.') ?></span></p>
<?php endif; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>"><?php echo $this->__('No options of this product are available.') ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>

<script type="text/javascript">decorateTable(’super-product-table’)</script>

 
Magento Community Magento Community
Magento Community
Magento Community
 
mattramage
Jr. Member
 
Total Posts:  24
Joined:  2009-01-21
 

I have got it halfway here but im stuck.

1. My whole layout has shifted and i lost my add to cart button

2 Im not sure if im passing the info properly to add an item to the cart

Here is the url
http://thefastlife.com/store/index.php/winner-baby-mens-t.html

This is my code now in my grouped.phtml

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_blank
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/**
 * Grouped product data template
 *
 * @see Mage_Catalog_Block_Product_View_Media
 * @see Mage_Catalog_Block_Product_View_Type_Grouped
 */
?>



<?php $_product 
$this->getProduct() ?>
<?php $_associatedProducts 
$this->getAssociatedProducts() ?>
<?php 
if($_product->isSaleable() && count($_associatedProducts)): ?>
    
<class="availability"><?php echo $this->__('Availability'?>: <span class="in-stock"><?php echo $this->__('In stock'?></span></p>
<?php else: ?>
    
<class="availability"><?php echo $this->__('Availability'?>: <span class="out-of-stock"><?php echo $this->__('Out of stock'?></span></p>
<?php endif; ?>





<?php 
echo $this->__('SELECT YOUR PREFERED COLOR/SIZE'?>




<table">
  <tr>
    <td>
                

<label>
  <select name="
item_select" >
  
<?php if (count(
$_associatedProducts)): ?>
<?php foreach (
$_associatedProducts as $_item): ?>   

<?php if (
$_product->isSaleable()): ?>
<?php if (
$_item->isSaleable()) : ?>
<option value="
<?php echo $_item->getQty()*1 ?>"><?php echo $this->htmlEscape($_item->getName()) ?>

<?php else: ?>


<?php endif; ?>
<?php endif; ?>
</option>

<?php endforeach; ?>
<?php else: ?>
  </select>
</label>
         
    </td>
    <td>  <input name="
super_group[<?php echo $_item->getId() ?>]" type="text" value="$_item_select" size="3" />
  </td>
  </tr>
</table>               
                



<?php if (
$_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>"><?php echo $this->__('No options of this product are available.'?>
<?php 
endif; ?>






<script type="text/javascript">decorateTable('super-product-table')</script>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top