Jump to content

Change Product Image Size In BO (Orders)


Recommended Posts

Hi all

 

I was wondering if it was possible to change the size of the product image in the order page in BO.

 

I have tried the following solution (adding in overrides / controllers / admin

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, 200, '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;
	}
}

I then clear the tmp product image files.

 

However this does not work.  Images are still being created at 45px

 

Any help greatly appreciated

 

Thanks in advance

Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...