This feature follows the Wishlist function, constructs a new shopping cart system, user updates deletes the shopping cart item, operates the new database table
Two methods
Public Function removecancelbyajaxaction ()
{
$result = Array ();
$itemId = (int) $this->getrequest ()->getparam (' itemId ');
if ($itemId) {
try{
$newQuoteItemId = Mage::getmodel ("newshoppingcart/simulation")->addncitemtocart ($ITEMID);
$result [' status '] = "success";
$result [' content '] = $this->getlayout ()->createblock (' Checkout/cart_totals ')->settemplate (' checkout/ Cart/totals.phtml ')->tohtml ();
$result [' newquoteid '] = $newQuoteItemId;
}catch (Exception $e) {
$result [' status '] = "fail";
$result [' error '] = "Exception when called Addnitemtocart function,msg:". $e->getmessage ();
}
}
echo Json_encode ($result);
}
Public Function removecancelbyajaxaction ()
{
$result = array ();
$itemId = (int) $this->getrequest ()-& Gt;getparam (' itemId ');
if ($itemId) {
try{
$newQuoteItemId = Mage::getmodel ("newshoppingcart/simulation")->addncitemtocart ($ ITEMID);
$result [' status '] = "success";
$result [' content '] = $this->getlayout ()->createblock (' Checkout/cart_totals ')->settemplate (' Checkout /cart/totals.phtml ')->tohtml ();
$result [' newquoteid '] = $newQuoteItemId;
}catch (Exception $e) {
$result [' status '] = ' fail ';
$result [' error '] = ' Exception when call Addnitemtocart fun Ction,msg: ". $e->getmessage ();
}
Echo Json_encode ($result);
}