perusi Posted January 30, 2014 Share Posted January 30, 2014 I`m interested in showing a bigger image in the Order details page in BO. Now it currently displays the mini image, but i`m interested in showing a bigger image. I don't want to modify the mini image size and height, but to ask for another image size. I know this is the code to modify in _product_line.tpl from admin/themes/default/template/controllers/orders <td align="center">{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}</td> I`m using PS 1.5.3.1 Thanks Link to comment Share on other sites More sharing options...
Sazuki Posted March 24, 2014 Share Posted March 24, 2014 (edited) Same here. Any help will be appreciated. Edited March 24, 2014 by Sazuki (see edit history) Link to comment Share on other sites More sharing options...
mantobani Posted March 25, 2014 Share Posted March 25, 2014 Hi friends. First create an override Create a file in > override\controllers\admin\AdminOrdersController.php Then add this code: class AdminOrdersController extends AdminOrdersControllerCore { protected function getProducts($order) { $products = $order->getProducts(); foreach ($products as &$product) { if ($product['image'] != null) { $name = 'product_mini_'.(int)$product['product_id'].(isset($product['product_attribute_id']) ? '_'.(int)$product['product_attribute_id'] : '').'.jpg'; // generate image cache, only for back office $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$product['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); if (file_exists(_PS_TMP_IMG_DIR_.$name)) $product['image_size'] = getimagesize(_PS_TMP_IMG_DIR_.$name); else $product['image_size'] = false; } } return $products; } } Look at the code when says $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$product['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); Change the number 45, to 100 or 150, this is the size in pixels. Go to images/tmp/ then delete the product cached images, they look like "product_mini_780_1500.jpg" The sistem will regenerate automaticly the images to this new size when you deletes the smallers. I tested this on only orders, but this will affects to the entire backoffice, because the temp image is used in products lists an other admin pages. Link to comment Share on other sites More sharing options...
moraira Posted August 18, 2014 Share Posted August 18, 2014 great, run in PS 1.6.0.9 too Link to comment Share on other sites More sharing options...
boutik-fan Posted March 2, 2015 Share Posted March 2, 2015 Hello, Thank you for the tips. I would like to make it working on the product list of the back office on PS 1.6, to get the product_mini size to 250 px. But the product_mini keeps a small size !! I have deleted the tmp picture file. I have tried to override with the same code the AdminProductscontroller. I have modifyed the image size of the product_mini and regenerated the thumbnails.. I also change the size in the classes/adminTab If you have an idea that would be great. Thank you in advance ! Link to comment Share on other sites More sharing options...
KevinNash Posted August 29, 2016 Share Posted August 29, 2016 (edited) To change product list image size, go to classes/helper/HelperList.php Edit this line : $this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType); And like before, change the 45 value for anything you want Edited August 29, 2016 by KevinNash (see edit history) Link to comment Share on other sites More sharing options...
JamesBen08 Posted November 14, 2017 Share Posted November 14, 2017 Hello , I tried to make the same thing on pictures on invoces on PS 1.6.1.15 I would like to make the pictures of products on invoces pdf , more bigger Any ideas please ? Regards Link to comment Share on other sites More sharing options...
siomosp Posted July 2, 2018 Share Posted July 2, 2018 (edited) Hello! There is a way to make this image, at order details product line, a link to the product at the Store Front? Regards Edited July 2, 2018 by siomosp (see edit history) Link to comment Share on other sites More sharing options...
ENS Enterprises Posted July 3, 2018 Share Posted July 3, 2018 Yes, you just need to edit the template file of invoice. Link to comment Share on other sites More sharing options...
DARKF3D3 Posted August 6, 2018 Share Posted August 6, 2018 Hello, do you know how to do this on PS.1.7.4? Link to comment Share on other sites More sharing options...
eviatar Posted January 31, 2019 Share Posted January 31, 2019 On 3/25/2014 at 9:46 PM, mantobani said: Hi friends. First create an override Create a file in > override\controllers\admin\AdminOrdersController.php Then add this code: class AdminOrdersController extends AdminOrdersControllerCore { protected function getProducts($order) { $products = $order->getProducts(); foreach ($products as &$product) { if ($product['image'] != null) { $name = 'product_mini_'.(int)$product['product_id'].(isset($product['product_attribute_id']) ? '_'.(int)$product['product_attribute_id'] : '').'.jpg'; // generate image cache, only for back office $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$product['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); if (file_exists(_PS_TMP_IMG_DIR_.$name)) $product['image_size'] = getimagesize(_PS_TMP_IMG_DIR_.$name); else $product['image_size'] = false; } } return $products; } } Look at the code when says $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$product['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); Change the number 45, to 100 or 150, this is the size in pixels. Go to images/tmp/ then delete the product cached images, they look like "product_mini_780_1500.jpg" The sistem will regenerate automaticly the images to this new size when you deletes the smallers. I tested this on only orders, but this will affects to the entire backoffice, because the temp image is used in products lists an other admin pages. hi i've tried on Prestashop 1.7.5 it show me "internal error 500" can you explain me what to change in this code for 1.7.5 version please ? thank you very much !! Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 31, 2019 Share Posted January 31, 2019 (edited) 7 ore fa, eviatar dice: hi i've tried on Prestashop 1.7.5 it show me "internal error 500" can you explain me what to change in this code for 1.7.5 version please ? thank you very much !! On PS1.7 make a backup copy of this file: /controllers/admin/AdminOrdersController.php Then find these 2 rows: Around row 1813: $pack_item['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$pack_item['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); Around row 2807: $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$product['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); On both change 45 with the size you need. In my case I set them to 160. Last step it's to delete tmp image cache... To do this locate images/tmp/ folder and delete alla the images images with name that start with "product_mini_". Hope this helps. Edited January 31, 2019 by DARKF3D3 (see edit history) 2 Link to comment Share on other sites More sharing options...
eviatar Posted February 12, 2019 Share Posted February 12, 2019 On 1/31/2019 at 8:40 PM, DARKF3D3 said: On PS1.7 make a backup copy of this file: /controllers/admin/AdminOrdersController.php Then find these 2 rows: Around row 1813: $pack_item['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$pack_item['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); Around row 2807: $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$product['image']->getExistingImgPath().'.jpg', $name, 45, 'jpg'); On both change 45 with the size you need. In my case I set them to 160. Last step it's to delete tmp image cache... To do this locate images/tmp/ folder and delete alla the images images with name that start with "product_mini_". Hope this helps. oh sorry i've forgot to say to you thank you ! it's perfect thank you very much ! Link to comment Share on other sites More sharing options...
sfweb Posted July 19, 2019 Share Posted July 19, 2019 If you want you can use this module, it shows the products images directly in the orders list page, so you don't need to access in the order detail page: https://addons.prestashop.com/en/combinaisons-customization/39933-products-image-in-orders-list.html Link to comment Share on other sites More sharing options...
d.ivanchev Posted February 12, 2021 Share Posted February 12, 2021 Hi, how can I resize images to image product list into BO Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 7, 2021 Share Posted September 7, 2021 I case someone it's interested to do this on PS1.7.7... you have to look at file: /httpdocs/src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php Search for 45 and replace with the desidered value (the value it's the size of the thumbnail in pixel). After this modify probably you should delete all the images that start with "product_mini_" into /img/tmp folder, in this way PS will regenerate them with the new size. Link to comment Share on other sites More sharing options...
Ponas Programuotojas Posted November 14, 2023 Share Posted November 14, 2023 On 9/7/2021 at 10:08 PM, DARKF3D3 said: I case someone it's interested to do this on PS1.7.7... you have to look at file: /httpdocs/src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php Search for 45 and replace with the desidered value (the value it's the size of the thumbnail in pixel). After this modify probably you should delete all the images that start with "product_mini_" into /img/tmp folder, in this way PS will regenerate them with the new size. Prestashop 8.1.2 not working Link to comment Share on other sites More sharing options...
DARKF3D3 Posted November 14, 2023 Share Posted November 14, 2023 To me it works on PS8.1. After the modify did you deleted the thumbnails from tmp folder? 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