How do You Add Custom Wish List Button

One of the best tools in eCommerce is a wish list in Magento, it helps the customers to store their wanted or liked products for future purchase. So with this tool, the customer can purchase their selected item in their next purchases.

The only thing the customer has to do is, they have to register and store their desired item on the wish list. He also gets a convenient option to purchase the list of the selected item in a single go.


<a href="#"
 class="action towishlist"
 title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
 aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
 data-post='<?php /* @escapeNotVerified */ /*echo $block->getAddToWishlistParams($_product);*/    echo $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($product)?>'
 data-action="add-to-wishlist"
 role="button">
  <i class="fa fa-heart-o" aria-hidden="true"></i>
  </a>

Conclusion:

You can use the code in Magento development. Please share your review in the comment section.

We Serve clients globally in diverse industries

Stay Upto Date With Our Newsletter.