Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 862 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 862 Bytes

Magento

Package

package-magento2-imagehover

Module

Icube_ImageHover

Dependency

Magento_Catalog Magento_Swatch

Description

This module is used for showing alternative image on hovering product item on product list.

How to use

On product list template, call the available alternative image of a product like so:

$_helperGallery = $this->helper('Icube\ImageHover\Helper\Data');
$_hoverImage = $_helperGallery->getHoverImage($_product);

Then add data-altimg attribute on prdocut image anchor tag, e.g:

<a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1" data-altimg="<?php echo $_hoverImage ?>">
      <?php echo $productImage->toHtml(); ?>
</a>