1

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.

   https://temperley.localhost/shop/myaccount/checkout/wishlist/product:25192

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 – David Manners May 20 '14 at 16:13
1

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

https://temperley.localhost/shop/myaccount/checkout/wishlist/product/25192

or (the classic way)

https://temperley.localhost/shop/myaccount/checkout/wishlist/?product=25192
  • 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 – develophper Jan 16 '14 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. – Fabian Blechschmidt Jan 17 '14 at 7:10

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.