1

We have a separate new page for listing the products, there we need a "Wishlist" option as like as in product catalog page.

Can anyone share the exact idea to implement it?.

0

Please try below steps. 1. Add below line for add to wishlist url.

<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 Wish List</span></a>

And then after you can call script at the end of file.

<script type="text/x-magento-init">
{
    "*": {
        "Magento_Ui/js/core/app": {
            "components": {
                "wishlist": {
                    "component": "Magento_Wishlist/js/view/wishlist"
                }
            }
        }
    }
}

</script>

Thanks

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.