This is a 2 part question:

  1. Currently if a guest customer presses "Add to Wishlist" button they are redirected to the login/register page without any message. How would I go about adding a message such as "The add to wishlist feature is only available to registered users, please login or signup for an account to use it".
  2. Once the customer has logged in after pressing the "Add to Wishlist" button they are redirected to the wishlist page but it does not added the product. How can I get it to add the product after login or alternatively redirect to the product page with a message to say you can now add to wishlist.

1 Answer 1


This is about question number 1.

You can create a script on your list.phtml or any phtml file that has a add to wishlist link.



As you can see below just add your add to wishlist link class on the jquery function.

    require(["jquery"], function($){
            alert("You need to Login/Register before you can proceed.");

</script> <!-- Custom Script to inform users that they need to create an account before using this feature. -->

Here's my wishlist.phtml code screenshot enter image description here

I hope this method will help you.

  • using above code i got this error "Uncaught Error: Call to a member function getTypeId() on null"
    – sudo55
    Commented May 3, 2019 at 9:52

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.