I have existing product slider and that slider made with object manager so I want to add the product to wishlist by Product id Using Object Manager.

1 Answer 1


I have found a solution.

<a href="#" data-post='<?php  echo $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>Add to wishlist</span></a>

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.