enogael Posted February 6, 2014 Share Posted February 6, 2014 (edited) Hi, I'd like to change the size of the images displayed in the crossselling module on the product page, that are currently set to 'medium', so that they would be the same size as my home images (way bigger). <img src="{$orderProduct.image}" alt="{$orderProduct.name|htmlspecialchars}"> As I understand it the size is hard coded in the crossselling.php file (seriously ?), $orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], ImageType::getFormatedName('medium')); but is it possible to change the size without having to edit this file ? I'm selling a theme and can't override any PHP, or am I wrong ? I'm not gonna have to duplicate the crossselling module and give it a new name, then edit the PHP just to change the size of the images ? Thanks for any help. Edited February 7, 2014 by enogael (see edit history) Link to comment Share on other sites More sharing options...
Sharak Posted February 7, 2014 Share Posted February 7, 2014 Try this {$link->getImageLink($orderProduct.link_rewrite, $orderProduct.id_image, 'home_default')|escape:'html'} instead of {$orderProduct.image} 1 Link to comment Share on other sites More sharing options...
enogael Posted February 7, 2014 Author Share Posted February 7, 2014 Oh man, that was so simple, works a charm ! Obviously PHP isn't my thing. Thanks a lot ! Link to comment Share on other sites More sharing options...
Sharak Posted February 8, 2014 Share Posted February 8, 2014 Oh man, that was so simple, works a charm ! Obviously PHP isn't my thing. Thanks a lot ! PHP is not my strong thing either. Sometimes all you need to do is think a little Normally product images in prestashop are loaded with this code: {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'} Crosselling module uses similar code to determine {$orderProduct.image} that is used to load images: $orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], ImageType::getFormatedName('medium')); so it seemed logical that changing $product to $orderProduct in first code should do the trick Link to comment Share on other sites More sharing options...
enogael Posted February 10, 2014 Author Share Posted February 10, 2014 PHP is not my strong thing either. Sometimes all you need to do is think a little Normally product images in prestashop are loaded with this code: {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'} Crosselling module uses similar code to determine {$orderProduct.image} that is used to load images: $orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], ImageType::getFormatedName('medium')); so it seemed logical that changing $product to $orderProduct in first code should do the trick Not logical for my brain ! ;p But thanks for your explanation, it's clearer now ! Link to comment Share on other sites More sharing options...
frosticek Posted March 5, 2014 Share Posted March 5, 2014 @Sharak Thanks for your input, it helped me a lot 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