I've taken over a project from someone else and am having trouble fixing a bug on the checkout/cart page. When an item is added and you're redirected to domain.com/checkout/cart
when you try to remove the item, the page seems to reload but the item is still there until you manually refresh. Sometimes have the same issue with adding an item, won't appear until you refresh the page.
I've tried debugging in app/design/frontend/rwd/<theme>/template/checkout/cart.phtml
but when trying to var_dump($this->getItems())
the page hangs and eventually crashes. I'm trying to see at what point the system recognises that items have been added/removed. How else can I go about outputting the items currently in the cart?
I have the other code that is generally linked to update not working
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php echo $this->getChildHtml('form_before') ?>
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
<?php echo $this->getBlockHtml('formkey'); ?>
It seems to be able to retrieve getItems()
but unable to dump the returned data.
<?php foreach($this->getItems() as $_item): ?>
<?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>
256M
and still hangsvar_dump
a collection, the data can be enormous, and it's generally not very useful for debugging purpose. The delete action happens in app\code\core\Mage\Checkout\controllers\CartController.php. Look forpublic function deleteAction()
and add$this->_getSession()->addNotice('item count='.$this->_getCart()->getItemsCount());
before the last line$this->_redirectReferer(Mage::getUrl('*/*'));
You can also add the notice at the beginning to see if the item count reduces.ajaxDeleteAction
for minicart. You should check what is the URL for the delete icon in your cart page. The default URL should look something like this domain.com/checkout/cart/delete/id/<some number>/uenc/<some string>. If it is not like the default, then you should fix it.