Jump to content

Is it Possible to remove cover image in Gallery (product details page) ?


Recommended Posts

thanks to vekia.. i called this for,

cover image has weird look in my artshop. usually images playing important roles. so i've prepared cropped image (max. 192x192px) as thumb nail cover image for product list view but, when it comes to gallery view and jqzooming it looks so weird. 

 

the problem solved thorugh simple code :)

 

solution :

 

just update in /themes/theme_name/product.tpl

<span id="view_full_size">
    <a id="big_pic" class="pb-product-image jqzoom" href="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}" title="{$product->name|escape:'htmlall':'UTF-8'}">
       {foreach from=$images item=image name=thumbnails}
            {if $image.cover!=1}
                <img id="small_pic" cover="{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $image.id_image, 'thickbox_default')}" />
                {break}
            {/if}
       {/foreach}
    </a>
</span>

and , dont forget to close 'if' clause in following code

<div id="thumbs_list">
                        <ul id="thumbs_list_frame">
{foreach from=$images item=image name=thumbnails}
                                {assign var=imageIds value="`$product->id`-`$image.id_image`"}
                                {if $image.cover!=1}
                                <li id="thumbnail_{$image.id_image}">
Edited by mani313 (see edit history)
Link to comment
Share on other sites

Thanks mani313 - this is the exactly what I was looking for (and for exactly the same reasons as you!).  Not tested yet.  I am using 1.4.11, but I assume the principal is the same cross versions?

no! i'm using 1.5.3.1, and its not going to differ about versions i think. hope it'll help you ! :)

Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...

Hi

 

ver 1.6

after '{if $have_image}' - line 80 - add this code

{foreach from=$images item=image name=bigImg key=i}
                        {if $smarty.foreach.bigImg.iteration == 2}
                            {assign var=imageLegendCover value=$image.legend|escape:'html':'UTF-8'}
                            {assign var=imageIdCover value=$image.id_image}
                        {/if}
                    {/foreach}

then you should change variable 

$cover.legend - $imageLegendCover

$cover.id_image - $imageIdCover

<span id="view_full_size">
						{if $jqZoomEnabled && $have_image && !$content_only}
							<a class="jqzoom" title="{if !empty($imageLegendCover)}{$imageLegendCover|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" rel="gal1" href="{$link->getImageLink($product->link_rewrite, $imageIdCover, 'thickbox_default')|escape:'html':'UTF-8'}">
								<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $imageIdCover, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($imageLegendCover)}{$imageLegendCover|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($imageLegendCover)}{$imageLegendCover|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"/>
							</a>
						{else}
							<img id="bigpic" itemprop="image" src="{$link->getImageLink($product->link_rewrite, $imageIdCover, 'large_default')|escape:'html':'UTF-8'}"
                                 title="{if !empty($imageLegendCover)}{$imageLegendCover|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"
                                 alt="{if !empty($imageLegendCover)}{$imageLegendCover|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"
                                 width="{$largeSize.width}" height="{$largeSize.height}"/>
							{if !$content_only}
								<span class="span_link no-print">{l s='View larger'}</span>
							{/if}
						{/if}
					</span>

and the last thing: thumbnails

{if $smarty.foreach.thumbnails.iteration != 1}
								<li id="thumbnail_{$image.id_image}"{if $smarty.foreach.thumbnails.last} class="last"{/if}>
									<a{if $jqZoomEnabled && $have_image && !$content_only} href="javascript:void(0);" rel="{literal}[spam-filter]/literal}gallery: 'gal1', smallimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'large_default')|escape:'html':'UTF-8'}',largeimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}'{literal[spam-filter]{/literal}"{else} href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}"	data-fancybox-group="other-views" class="fancybox{if $image.position == 2} shown{/if}"{/if} title="{$imageTitle}">
										<img class="img-responsive" id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'cart_default')|escape:'html':'UTF-8'}" alt="{$imageTitle}" title="{$imageTitle}"{if isset($cartSize)} height="{$cartSize.height}" width="{$cartSize.width}"{/if} itemprop="image" />
									</a>
								</li>
                                {/if}

In the BO you have to remember, when you add pictures to the gallery - first there must be cover.

Link to comment
Share on other sites

×
×
  • Create New...