Item names disappear on checkout in Magento

2019-09-15 10:51发布

问题:

I have a problem in my Magento site wherein an item in a cart of a registered customer doesn't get cleared after checking out. Thus I searched stackoverflow and found this solution: magento shopping cart does not get clear

After implement it by adding this in my one page checkout phtml file, the item names and picture disappear.

 foreach( Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection() as $item ){

     Mage::getSingleton('checkout/cart')->removeItem( $item->getId() )->save();
 }

Now, I can place an order without any problems. The cart now clears after checking out. However, in the reviews block, I can only see the prices, the item name, description and photo are now gone. :(

I think the problem is in this line, but I'm not sure: ->getQuote()->getItemsCollection() as $item. Maybe my $item is different or should be replace to something to show the items.

Did I miss something or forgot to add something in the code? :(

回答1:

First of remove the code and check any third party module have you installed.

If then disabled that module and check it.



标签: php magento