This page, is not the product page, its actually a special page used to adjust a product, notice the URL for example in this its product ID 5
checkout/cart/configure/id/5/
That is a custom page, that has a special controller and action
Mage_Checkout_CartController
/**
* Action to reconfigure cart item
*/
public function configureAction()
{
// Extract item and product to configure
$id = (int) $this->getRequest()->getParam('id');
$quoteItem = null;
$cart = $this->_getCart();
if ($id) {
$quoteItem = $cart->getQuote()->getItemById($id);
}
if (!$quoteItem) {
$this->_getSession()->addError($this->__('Quote item is not found.'));
$this->_redirect('checkout/cart');
return;
}
try {
$params = new Varien_Object();
$params->setCategoryId(false);
$params->setConfigureMode(true);
$params->setBuyRequest($quoteItem->getBuyRequest());
Mage::helper('catalog/product_view')->prepareAndRender($quoteItem->getProduct()->getId(), $this, $params);
} catch (Exception $e) {
$this->_getSession()->addError($this->__('Cannot configure product.'));
Mage::logException($e);
$this->_goBack();
return;
}
}
this Helper is the actual source of the save configuration
Mage::helper('catalog/product_view')->prepareAndRender($quoteItem->getProduct()->getId(), $this, $params);
What I think is the actual problem is that the QTY is being set to 0, or false, and is ignored as a change, when its passed through this Helper. So, its not really a bug, its more of a matter of trying to use a method to remove a product, that its not intended for. The trash can on the cart is the right use.
Now, if you wanted, you could do a rewrite of the helper and manage this yourself by checking the $params and then removing it from the cart:
/**
* Prepares product view page - inits layout and all needed stuff
*
* $params can have all values as $params in Mage_Catalog_Helper_Product - initProduct().
* Plus following keys:
* - 'buy_request' - Varien_Object holding buyRequest to configure product
* - 'specify_options' - boolean, whether to show 'Specify options' message
* - 'configure_mode' - boolean, whether we're in Configure-mode to edit product configuration
*
* @param int $productId
* @param Mage_Core_Controller_Front_Action $controller
* @param null|Varien_Object $params
*
* @return Mage_Catalog_Helper_Product_View
*/
public function prepareAndRender($productId, $controller, $params = null)
{
// Prepare data
$productHelper = Mage::helper('catalog/product');
if (!$params) {
$params = new Varien_Object();
}
// Standard algorithm to prepare and rendern product view page
$product = $productHelper->initProduct($productId, $controller, $params);
if (!$product) {
throw new Mage_Core_Exception($this->__('Product is not loaded'), $this->ERR_NO_PRODUCT_LOADED);
}
/*
* Do some fancy stuff to remove the product from the cart
* now that we know there is a product and we have the $params
* sorry no really fancy logic here is just for an example
* also you may want to verify the start/stop of the if(!(int)$params->getData('qty'))
*
*
*/
if(!(int)$params->getData('qty'))
{
// remove product from cart
}
else
{
$buyRequest = $params->getBuyRequest();
if ($buyRequest) {
$productHelper->prepareProductOptions($product, $buyRequest);
}
if ($params->hasConfigureMode()) {
$product->setConfigureMode($params->getConfigureMode());
}
Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product));
if ($params->getSpecifyOptions()) {
$notice = $product->getTypeInstance(true)->getSpecifyOptionMessage();
Mage::getSingleton('catalog/session')->addNotice($notice);
}
} // end logic if we are removing item from cart
Mage::getSingleton('catalog/session')->setLastViewedProductId($product->getId());
$this->initProductLayout($product, $controller);
$controller->initLayoutMessages(array('catalog/session', 'tag/session', 'checkout/session'))
->renderLayout();
return $this;
}