0

How can I add a product to my wishlist without the page reloading? I tried the answer on this but it still reloads the page.

Using

return false;

and

event.preventDefault();

stops the link from adding the product to the wishlist altogether on my homepage while it doesn't affect the link in the single product pages (still reloads but adds the product to wishlist).

How do I pull this off? I want a pop-up for logged in customers to confirm that the product is added to wishlist but I don't know how to use AJAX on Magento's wishlist.

Here's my development site: LINK

2

One way to do this would be to create your own controller and action that will take the same information add to the wishlist but simply return a json response with success or a failure message.

In this way you can skip all the redirect stuff and work with a simply ajax action.

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.