Jump to content

[solved] Custom Image Size for Featured Product wont work


Recommended Posts

Hello Everyone,

 

I need help with image sizes, specifically the Featured Product Images.

 

In the BO I added an image default size called featured_image (179px by 179px) and linked it to products.  In the applicable files I added and changed the home featured products to use the new size.  Below you'll see the files that I changed.  You'll see that the homefeatured images had homeSize set as the size but when I look at the website I only see large_default images being used.  What did I do wrong?

 

gentechscientific.com

 

homefeatured.php change:

'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
to
'featuredSize' => Image::getSize(ImageType::getFormatedName('featured')),

homefeatured.tpl change:

<img src="{$link->getImageLink ($product.link_rewrite, $product.id_image, 
'home_default')|escape:'html'}"
height="{$homeSize.height}" width="{$homeSize.width}" 
alt="{$product.name|escape:html:'UTF-8'}" />
to
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 
'featured_default')|escape:'html'}" 
height="{$featuredSize.height}" width="{$featuredSize.width}" 
alt="{$product.name|escape:html:'UTF-8'}" />

CategoryController.php added:

$this->context->smarty->assign(array(
'featuredSize' => Image::getSize(ImageType::getFormatedName('featured')),

ProductController.php added:

$this->context->smarty->assign(array(
'featuredSize' => Image::getSize(ImageType::getFormatedName('featured')), 
Edited by n13design (see edit history)
Link to comment
Share on other sites

Found the missing problem.  I was editing the homefeatured files in the main module folder.  I just looked in the theme and found the homefeatured.tpl file that was using the large_default size.  Everything is fixed now! 

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