Magento – How to make Wish List items not disappear after customer orders

magento-1.9wishlist

I am trying to figure out how to get the customer wish list to KEEP the items in the wish list after the customer puts them in their cart / orders so they can order them again later as well.

Anyone know the file I would edit to do this (ie. comment out the part where it takes the product out of the wish list if it is put in the shopping cart)? or would something like Amasty Favorite Products extension be best?

Thanks.

Best Answer

In app/code/core/Mage/Wishlist/controllers/IndexController.php -> public function cartAction() replace this:

if ($item->addToCart($cart, true)) {

with this:

if ($item->addToCart($cart, false)) {

or directly remove the second parameter (true), because this calls app/code/core/Mage/Wishlist/Model/Item.php -> public function addToCart(Mage_Checkout_Model_Cart $cart, $delete = false) (@param bool $delete delete the item after successful add to cart).


The above is working only when "Add to cart" button is used. For button "Add all to cart" you should replace in app/code/core/Mage/Wishlist/Controller/Abstract.php -> public function allcartAction() this code:

if ($item->addToCart($cart, $isOwner)) {

with this:

if ($item->addToCart($cart, false)) {

Or you can just comment/remove $this->delete(); from app/code/core/Mage/Wishlist/Model/Item.php -> public function addToCart.

Related Topic