0

How can I make the product only be copied in wishlist, when I click move to wishlist from basket. Because on default it remove from basket but I want my product to be added in wishlist and also to stay in basket. For moveing from wishlist to cart i have edited

app\code\core\Mage\Wishlist\controllers\IndexController.php on row 518 this piece of code from true to false

if ($item->addToCart($cart, false)) {
   $cart->save()->getQuote()->collectTotals();
}

but what about from cart to wishlist. I have tried to find something to CartControler.php but there is nothing that I can do.

1

Check on line 580 in the app\code\core\Mage\Wishlist\controllers\IndexController.php controller, method fromcartAction.

The following piece of code removes the product from the quote.

$cart->getQuote()->removeItem($itemId);
  • Thanks a lot i have't seen that it was very easy fix, only comment this line and line under and that's it. Works like a charm. – Mike Mar 26 '14 at 14:25
  • no problem, glad I could help. It's not the prettiest way to fix this but probably the only. Don't forget to close the question by accepting the answer. – Sander Mangel Mar 26 '14 at 14:30
0

The moving of products from cart to wishlist is done in Mage_Wishlist_Model_Observer::processCartUpdateBefore.
The line that removes the product from the cart when it is added to the wishlist is

$cart->getQuote()->removeItem($itemId);

But if you remove this please change the heading of the 'Move to wishlist' column to 'Copy to wishlist' so you won't confuse your customers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.