How to get wishlist image by product Magento 2?

Get Wishlist thumbnail image by the product SKU to display the Wishlist item image on the page Magento 2.

You need to required product SKU to fetch product object, based on the object, pass image id as wishlist_thumbnail to fetch thumb of the product.

Using ImageFactory class to fetch wishlist image programmatically,

From the template call method,

When you call the method, it returns the Image object and from that object call toHtml() method to retrieve thumbnail of the wishlist item.

Given code snippet for Wishlist Thumbnail Image by product SKU Magento 2. You can use the Retrieve Wishlist image to display on the grid of the wishlist.

Leave a Reply