Jump to content

Remove "second image" rollover effect


Recommended Posts

Hi

 

We are currently running http://svenskautekok.se/.

 

As you can see on the front page we have a "rollover" effect on the homefeatured products. When you put the mouse over it another image shows up. We dont want this. We just want it to be one single still picture. Same goes for product page etc.

 

How do we do this?

 

(The second image seems to be random aswell and no logic, why is this? :S)

Edited by Emilll (see edit history)
Link to comment
Share on other sites

You need edit your product-list.tpl, in the home featured you need edit the tpl of this module also, search for the link img <a class="product_img_link" and comment or delete the second img tag.

Link to comment
Share on other sites

Hi, which code should i delete? Tried some but didnt work very well..

 

                        <a class="product_img_link"    href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
                            <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />

                                                        
{assign var='productImgs' value=Product::getProductImages($product.id_product)}
{assign var='flag' value=0}
{foreach from=$productImgs item=productImg name=productImgs}
    
    {if $flag !== 0}
        {assign var=imageIds value="`$product.id_product`-`$productImg.id_image`"}
        {if $link->getImageLink($product.link_rewrite, $imageIds, 'home_default')}
            <img class="second_img replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $imageIds, 'home_default')}" />
            {assign var=flag value='true'}
            {break}
        {/if}
    {/if}

Link to comment
Share on other sites

And how about if you only comment the code that generate the second image?
For example using the code you has pasted here, just replace for this below:
 

<a class="product_img_link"    href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">                            <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />
                                                       {assign var='productImgs' value=Product::getProductImages($product.id_product)}{assign var='flag' value=0}{foreach from=$productImgs item=productImg name=productImgs}       {*{if $flag !== 0}        {assign var=imageIds value="`$product.id_product`-`$productImg.id_image`"}        {if $link->getImageLink($product.link_rewrite, $imageIds, 'home_default')}            <img class="second_img replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $imageIds, 'home_default')}" />            {assign var=flag value='true'}            {break}        {/if}    {/if}*}

 

But keep in mind something, this code looks like a code of the file product-list.tpl, and you are trying to change that effect in the home, so, you need remove/comment the code of the second image in the tpl of the module homefeatured or whatever module that is displaying in the home page, I said the module homefeatured, but I'm not sure if that is the module of your shop in the home page.
 
I hope this can help you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...