Magento Forum

Adding more then one Product with qty at the same time to cart
 
timocin
Jr. Member
 
Total Posts:  11
Joined:  2008-10-20
 

Hi,

i realy got a big problem! I have build a module that gives me a table of colors and products for e.g. T-Shirts.

Link to table

Now what must i do to be able to add one or more then one, e.g. 3, products of this table the same time to cart?

And this is the code of the table

<?php if(isset($colortable)): ?>
<?php $array 
$colortable->getColorProducts(); ?>
<div>
    <
div class="head">
        <
h4><span><?php echo $this->__('Dieser Artikel ist in folgenden Farben, Farbkombinationen und Größen verfügbar:'?></span></h4>
    </
div>    
    <
table  class="product-pricing" width="100%">
    
<?php foreach($array as $color):?>
    
<tr>
        <
td>
            <
table width="100%">
            <
tr>
                <
td>
                    <
table width="90%">
                        <
tr>
                            
<?php foreach($color['hexColors'as $hexColors): ?>
                                
<td width="15%" bgcolor="<?php echo $hexColors?>">&nbsp;</td>
                            
<?php endforeach;?>        
                        
</tr>
                    </
table>
                </
td>
            </
tr>
            <
tr>
                <
td>
                    <
table width="100%">        
                    
<?php foreach($color['products'as $products): ?>
                    <?php $_product 
$this->getProduct()->load($products['id'])?>
                    
<tr>
                        <
td align="center" width="5%"><?php echo $products['size']?></td>
                        <
td align="center" width="20%"><?php echo $products['singlePrice']?></td>
                        
<?php foreach($products['tierPrice'as $price):?>
                            
<td width="20%"><span class="price"><?php echo $this->__('ab'?></span>        
                                <
span class="price"><?php echo $this->__($colortable->toInt($price['price_qty'])) ?>:</span>        
                                <
strong><span class="price"><?php echo $this->__($price['formated_price']?></span></strong>
                            </
td>                            
                        
<?php endforeach;?>
                        
<td width="20%">
                            <
fieldset class="add-to-cart-box">
                                      <
legend>In den Warenkorb</legend>
                                      <
span class="qty-box"><label for="qty">Stück:</label>
                                      <
input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" /></span>                                                    
                                  </
fieldset>
                        </
td>
                    </
tr>
                        
<?php endforeach;?>
                    
</table>    
                </
td>
            </
tr>
            </
table>
        </
td>
    </
tr>
    
<?php endforeach;?>
    
</table>
    <
button class="form-button" value="" onclick="productAddToCartForm.submit()"><span><?php echo $this->__('Add to Cart'?></span></button>
</
div>
<?php endif; ?>

thanks for all help i can get

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top