zwacklmann Posted May 25, 2011 Share Posted May 25, 2011 $smallSize.height The Variable is not working in product.tpl. Why is that?In PrestaShop 1.4.1 the base theme is using the following code in the product.tpl to display the thumbnail images of the product. getImageLink($product->link_rewrite, $imageIds, 'medium')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" /> I've changes this to getImageLink($product->link_rewrite, $imageIds, 'small')}" alt="{$image.legend|htmlspecialchars}" height="{$smallSize.height}" width="{$smallSize.width}" /> That didn't do the trick though, as the width and height variables are undefined and result in the images to be displayed in 0x0 size in IE. Link to comment Share on other sites More sharing options...
midiman Posted May 26, 2011 Share Posted May 26, 2011 I think that you shouldn't change that, and instead you may define the width and height you need for mediumSize in preferences->imagesIf yo think you need to change it, you shoul edit controllers->ProductController.php and insert this code in line 252... 'smallSize' => Image::getSize('small'), just under 'mediumSize' => Image::getSize('medium'), Then you may use smallSize in product.tpl. Notice that you should also change the src of the image to get the small image instead medium one: src="{$link->getImageLink($product->link_rewrite, $imageIds, 'small')}" Hope this helps Link to comment Share on other sites More sharing options...
Raphaël Malié Posted May 26, 2011 Share Posted May 26, 2011 You shouldn't modify ProductController.php, use the override folder to create a file ProductController.php in controllers folders with this class : class ProductController extends ProductControllerCore { } and add in this class the method you want to modify from the original ProductController.php file, and apply midiman fix then. So when you will upgrade your PrestaShop to next version, you won't loose your modifications. 1 Link to comment Share on other sites More sharing options...
midiman Posted May 26, 2011 Share Posted May 26, 2011 Thank you Raphaël, I didn't know anything about override folder... Is there any place where I can find prestashop's core documentation? Without it, to make any changes is like shooting in the dark... Link to comment Share on other sites More sharing options...
zwacklmann Posted June 2, 2011 Author Share Posted June 2, 2011 Very valuable info! Thanks. Link to comment Share on other sites More sharing options...
midiman Posted June 2, 2011 Share Posted June 2, 2011 This will help anyone who is looking for information about Prestashop's core: the Rocky’sPrestaShop Development Guide. It's awesome!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now