3

When I click "Add All to Cart" on the wishlist page, I get a 404 error and the address in the bar is http://www.blahblahblah.com/wishlist/index/allcart/. The items are not added to cart.

A slightly different error occurs if I "Add all to Cart" from the share wishlist email, it then just goes straight to homepage.

I am using Magento CE v1.9.1.0 with unchanged version of /template/wishlist/view.phtml and have not changed any core files.

It looks like it's getting the wrong url?

  • Please check your /template/wishlist/view.phtml file and find this code near line no 55 <form id="wishlist-allcart-form" action="<?php echo $this->getUrl('*/*/allcart') ?>" method="post">. If this is there, please inspect element the same page and see if the action contains yourdomain/wishlist/index/allcart – Nasir Perwaiz Apr 23 '15 at 5:22
  • @nasir-perwaiz Yes, my code is the original unchanged code, that appears on line 55 identically. When I inspect element it shows: <form id="wishlist-allcart-form" method="post" action="example.com/wishlist/index/allcart"> – Pixielees Apr 23 '15 at 9:14
  • Ok, you can debug the code by just echoing the $redirectUrl at the end of the method allcartAction() inside the class app/code/core/Mage/Wishlist/Controller/Abstract.php on line no 216. This should return something like this yourdomain/wishlist/index/index/wishlist_id/1 . The wishlist_id could be anything – Nasir Perwaiz Apr 23 '15 at 10:00
  • @NasirPerwaiz I've found line 217: $this->_redirectUrl($redirectUrl); What code is it that I need to add, and is it before this line or after? I've tried echo $redirectUrl; – Pixielees Apr 23 '15 at 13:00
  • Just write echo $redirectUrl; die(); before $this->_redirectUrl($redirectUrl); and let me know the output. – Nasir Perwaiz Apr 23 '15 at 13:18