Skip to content

Magento 2 Module for showing alternative image on hovering product item on product list.

Notifications You must be signed in to change notification settings

yosefkurniawan/package-magento2-imagehover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

Magento 2 Module for showing alternative image on hovering product item on product list.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published