Jump to content

Change image


Recommended Posts

yeah 50000 is a problem.

 

Did you check that folder, question mark image there ?

 

If it is there then for presta that image is ok and that is why it does not show default language image.

 

One thing I notice is that question mark image is 125x125 but regular, good images are 212x170.

So maybe with some coding you could check width of image and then if equals 125 then use language default,

otherwise if 212 use regular image.

{assign var=current_image value=getimagesize($link->getImageLink($product.link_rewrite, $product.id_image, 'home_default'))}
	{if $current_image[0] eq 125} <img  ... {else} <img  ...{/if}

Something like that maybe.

Link to comment
Share on other sites

Hi, i have this good?

          {assign var=current_image value=getimagesize($link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html')}
					{if $current_image[0] eq 125}test{else}<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{if !empty($product.legend)}{$product.legend|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" {if isset($homeSize)} {/if} height="170" />{/if}
Edited by tozi (see edit history)
Link to comment
Share on other sites

yeah something like that. I changed instead test to have default image, got code from product.tpl but not sure if this could work .

This is not tested so make backups 

{assign var=current_image value=getimagesize($link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html')}
					{if $current_image[0] eq 125}
						<img src="{$img_prod_dir}{$lang_iso}-default-home_default.jpg" alt="{if !empty($product.legend)}{$product.legend|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" {if isset($homeSize)} {/if} height="170" />
					{else}
						<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{if !empty($product.legend)}{$product.legend|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" {if isset($homeSize)} {/if} height="170" />
					{/if}

but instead {$img_prod_dir}{$lang_iso}-default-home_default.jpg you could have full path to your server if those variables are not defined.

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...