문제

(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