<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nirali G</title>
    <description>The latest articles on DEV Community by Nirali G (@nirali_g_5eb01cd97de0ea58).</description>
    <link>https://dev.to/nirali_g_5eb01cd97de0ea58</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3880494%2F8852f55e-05a2-4591-819b-7221dd4ca7f6.jpg</url>
      <title>DEV Community: Nirali G</title>
      <link>https://dev.to/nirali_g_5eb01cd97de0ea58</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nirali_g_5eb01cd97de0ea58"/>
    <language>en</language>
    <item>
      <title>Magento 2 Hover Image Module for Hyvä Theme</title>
      <dc:creator>Nirali G</dc:creator>
      <pubDate>Wed, 15 Apr 2026 12:36:54 +0000</pubDate>
      <link>https://dev.to/nirali_g_5eb01cd97de0ea58/magento-2-hover-image-module-for-hyva-theme-31a5</link>
      <guid>https://dev.to/nirali_g_5eb01cd97de0ea58/magento-2-hover-image-module-for-hyva-theme-31a5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7gqbbb132w9ys8xrlrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7gqbbb132w9ys8xrlrj.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Magento 2 Hover Image Module for Hyvä Theme&lt;br&gt;&lt;br&gt;
Product RollOver Image functionality for category, search, upsell, cross-sell, and homepage.&lt;/p&gt;

&lt;p&gt;This module adds a hover (roll-over) image functionality for Magento 2 stores using the Hyvä theme.&lt;/p&gt;

&lt;p&gt;When a customer hovers over a product image, a secondary image is displayed, improving product visibility and user experience.&lt;br&gt;
A highly performant Magento 2 module that seamlessly changes the product image when a user hovers over it. Designed to work flawlessly across traditional Luma, Hyvä Themes, and Headless PWA deployments with true zero-config operation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auto Image Fetch&lt;/strong&gt;: Automatically use the &lt;strong&gt;2nd Image&lt;/strong&gt; from the product's image gallery as the hover image. No manual role assignment needed!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Image Option&lt;/strong&gt;: Automatically creates an administrative "Hover / RollOver Image" gallery role to deliberately define exactly what image triggers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hyvä Compatible&lt;/strong&gt;: Automatically detects Hyvä Themes and runs natively utilizing Alpine.js crossfade transitions avoiding any Knockout JS rendering latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selective Rendering&lt;/strong&gt;: Admin configuration lets you determine exactly which site areas evaluate the hover effect (Category pages, Grid vs List, Search pages, Related Products, Upsells).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animation Controls&lt;/strong&gt;: Customize fade transition opacity intervals seamlessly from 0.2 to 2.0 seconds utilizing CSS logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast &amp;amp; Lazy Load&lt;/strong&gt;: Native implementation of Alpine's &lt;code&gt;x-intersect&lt;/code&gt; automatically guarantees hover images are &lt;em&gt;never&lt;/em&gt; loaded until the user scrolls past them, defending top-tier Core Web Vitals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile Responsive&lt;/strong&gt;: Built-in Javascript hardware detection dynamically disables functionality on touch environments.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  GraphQL &amp;amp; PWA Studio Support
&lt;/h2&gt;

&lt;p&gt;For modern Headless operations (PWA Studio, VueStorefront), backend logic is natively extended into the GraphQL schema! The PWA resolves URLs rapidly and cleanly bypassing typical logic extraction processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GraphQL Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GetCategoryProducts&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;category_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;eq&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;pageSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;currentPage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ASC&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;total_count&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;sku&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;ethnic_rollover_image&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;small_image&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;ethnicRolloverConfig&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;animation&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;animation_duration&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;lazy_load&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;image_role&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;enabled_sections&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;✅ Via Composer (Recommended)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
composer require niraligajera/module-rollover-image-all-places

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Luma &amp;amp; Hyvä Installation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Download the core module into &lt;code&gt;app/code/Ethnic/RollOverImage&lt;/code&gt; or install via composer. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run Magento's CLI integration:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bin/magento module:enable Ethnic_RollOverImage
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Usage Settings
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Traverse to the Admin Panel: &lt;strong&gt;Stores &amp;gt; Configuration &amp;gt; Ethnic &amp;gt; RollOver Image&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Determine Global constraints via &lt;strong&gt;Enable RollOver Image&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;also allow to set default product image position . Like if you want to set second image on hover you can set
Also you can set ad image label Target an &lt;strong&gt;Image Role&lt;/strong&gt;: 

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Use 2nd Gallery Image&lt;/code&gt;: Engages Zero-Setup fallback mode.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Hover / RollOver Image&lt;/code&gt;: Targeted user uploads.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Dictate active sectors under &lt;strong&gt;Enabled Sections&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Save configuration and flush the block cache.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Technical Requirements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Magento Open Source / Commerce 2.4.X&lt;/li&gt;
&lt;li&gt;PHP 7.4 / 8.1 / 8.2 / 8.3 / 8.4 Compatible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧠 Frontend Behavior
&lt;/h2&gt;

&lt;p&gt;On hover → hover image is shown&lt;br&gt;
On mouse leave → main image is restored&lt;br&gt;
Fallback Logic&lt;/p&gt;

&lt;p&gt;If no hover image is assigned:&lt;/p&gt;

&lt;p&gt;Uses main image OR&lt;br&gt;
Optionally can use second gallery image&lt;br&gt;
📊 Bulk Upload (CSV)&lt;/p&gt;

&lt;p&gt;You can import hover images using Magento import.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample CSV Format:
&lt;/h2&gt;

&lt;p&gt;sku   hover_image&lt;br&gt;
  ABC123    /h/o/hover1.jpg&lt;br&gt;
  XYZ456    /h/o/hover2.jpg&lt;br&gt;
  🎨 Styling&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic CSS example:
&lt;/h2&gt;

&lt;p&gt;.product-image {&lt;br&gt;
    position: relative;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.product-image .hover-img {&lt;br&gt;
    position: absolute;&lt;br&gt;
    top: 0;&lt;br&gt;
    left: 0;&lt;br&gt;
    opacity: 0;&lt;br&gt;
    transition: opacity 0.3s ease;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.product-image:hover .hover-img {&lt;br&gt;
    opacity: 1;&lt;br&gt;
}&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡ Hyvä Compatibility
&lt;/h2&gt;

&lt;p&gt;Built using Hyvä best practices&lt;br&gt;
No heavy JavaScript&lt;br&gt;
Compatible with Alpine.js if needed&lt;/p&gt;

&lt;h2&gt;
  
  
  ❓ FAQ.
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;What if no hover image is set?&lt;br&gt;
Fallback will show the main product image (no break in UI).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Does it work on mobile?&lt;br&gt;
Hover is not applicable on mobile. Can be extended to tap behavior if required.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ⏱️ Estimated Performance Impact
&lt;/h2&gt;

&lt;p&gt;Minimal – uses CSS-based hover, no extra API calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 Future Improvements
&lt;/h2&gt;

&lt;p&gt;Admin preview of hover image&lt;br&gt;
Auto-pick second gallery image&lt;br&gt;
Animation effects (zoom / slide)&lt;br&gt;
PWA support&lt;br&gt;
👨‍💻 Author&lt;/p&gt;

&lt;h2&gt;
  
  
  Magento 2 Developer
&lt;/h2&gt;

&lt;p&gt;Hyvä | Performance | Custom Modules&lt;/p&gt;

&lt;p&gt;📄 License&lt;br&gt;
OSL-3.0 / AFL-3.0&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>magneto</category>
    </item>
  </channel>
</rss>
