Question

I put the form for the checkbox how many items the user want to buy:

<?php $haveProds = $this->getHaveProducts();?>
            <?php if($_product->isAvailable() && $haveProds) { ?>
                <div class="mergeContainer">
                    <?php if(!$_product->isGrouped()): ?>
                    <label for="qty">Wählen Sie Ihre gewünschte Menge</label>
                    <?php endif; ?>
                    <select name="qty" id="qty">
                      <?php $i = 1 ?>
                      <?php do { ?>
                        <option value="<?php echo $i?>">
                          <?php echo $i?>
                          <?php $i++ ?>
                        </option>
                        <?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMaxSaleQty()) ?>
                    </select>
                    <?php if ($_product->isSaleable() && $this->hasOptions()):?>
                        <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
                    <?php endif;?>
                    <?php if ($_product->isSaleable() && $this->hasOptions()):?>
                        <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
                    <?php endif;?>
                </div>
            <?php }?>

from my app/design/frontend/base/default/template/catalog/product/view-adopted.phtml to .../view/addtocart.phtml

so the user will be able to change the quantity directly above the add-to-cart button in the right box.

After that the selected value of the dropdown won't be overtaken in the cart anymore. If I click on "add to cart" now, just one item is added.

Unfortunately I can't find the function that reads this value. Can anyone help me?

Best Vanessa

Was it helpful?

Solution

So that we have an answer here.

What you should do is have this quantity field inside the add to cart form so that the button action productAddToCartForm.submit(this) will be able to load the requested quantity information and pass this to the cart itself.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top