_getCart()->setPrimaryKey($request['cartId']); $this->_getCart()->clearData(); foreach ($request['product'] as $productId => $quantity) { $this->_getDataObj()->setPrimaryKey($productId); $this->_getDataObj()->clearData(); $data = array( 'productId' => $this->_getDataObj()->getPrimaryKey(), 'quantity' => $quantity ); $result['success'][$productId] = $this->_addToCart($data); } } $this->_displayJson($result); exit; } protected function _postUpdate() { parent::_postUpdate(); $this->_setImagesRedirect(); return $this; } protected function _postInsert() { parent::_postInsert(); $this->_setImagesRedirect(); return $this; } protected function _setImagesRedirect() { $editImagesPostAction = App_ECommerce_Product_Admin_Form_Abstract::POST_ACTION_EDIT_IMAGES; if ($editImagesPostAction == Qs_Request::getRequestValue('postAction')) { $url = Qs_SiteMap::findFirst(null, array('type' => 'ECommerce_Product_Image_Admin_'), null, 'url'); if ($url) { $primary = (array) $this->_getDataObj()->getPrimaryKey(); $this->_setBackUrl($url . '/' . implode('/', $primary)); } } return $this; } }