質問

(Using magento 1,9).

I have made my own sidebar, with my own custom minicart. The minicart must be able to update the quantity of each product there's in the cart. Below is my code and what i have tried (short version):

<?php $cart = Mage::getModel('checkout/cart')->getQuote() ?>
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
<?php foreach($cart->getAllItems() as $item): ?>

<span><input type="text" class="minicartQty" name="cart[<?php echo $item->getId() ?>][qty]" id="minicartQty" value="<?php echo $item->getQty(); ?>" /></span>

<button type="submit" name="update_cart_action" value="empty_cart" class="button btn-update"><span><?php echo $this->__('Update cart'); ?></span></button>
<?php endforeach; ?>
</form>

But when i hit the update button, it perfectly redirects to the cart, but it has not updated the quantity of the chosen product. Maybe i am missing something here? :)

//Simon

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top