I have an option inside the cart to add a product to the wishlist which works fine.

   onclick="jQuery.get('<?php echo $this->getUrl('myaccount/checkout/wishlist') ?>', { product: <?php echo $_item->getProductId() ?> }).done(function(data) { location.reload(true); });

But if you are not logged in you are first taken to a log in page. After this I set up a redirect using the same url that is submitted from the cart to add a product to you wishlist.


Problem is this url does not work in this situation. I've tried using http instead of https and vice versa which isn't working. I would appreciate if anyone could describe how exactly I can add a product to the wishlist from a redirect off the login page or add a product by id to the wishlist

  • Is this a custom module as url for the wish list should look like: /wishlist/index/add/product/167/ or /wishlist/index/fromcart/item/93/ from the cart May 20, 2014 at 16:13

1 Answer 1


Magento adds the parameter with / to the url, therefore the url must be


or (the classic way)

  • I've tried using urls like that but it didn't work. Also when you are logged in the url in the format that I have used worked Jan 16, 2014 at 23:55
  • Interessting, it should work. You know, that everything is handled here: \Mage_Wishlist_IndexController::addAction. So the only suggestion I can give you is: Use xdebug, hook into the action method and check what happens. Jan 17, 2014 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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