From 627e3d8a7733c53836e51bc9a1ba375038c0dbf1 Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Mon, 12 Aug 2013 11:27:25 +0200 Subject: [PATCH] [-] BO : fixed multistore thumbnail on product list --- classes/helper/HelperList.php | 2 +- controllers/admin/AdminProductsController.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index b7915bb12..69a6127c2 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -259,7 +259,7 @@ class HelperListCore extends Helper $path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)$tr['id_image'] : '').'.'.$this->imageType; else $path_to_image = _PS_IMG_DIR_.$params['image'].'/'.Image::getImgFolderStatic($tr['id_image']).(int)$tr['id_image'].'.'.$this->imageType; - $this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType); + $this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'_'.$this->context->shop->id.'.'.$this->imageType, 45, $this->imageType); } elseif (isset($params['icon']) && isset($tr[$key]) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default']))) { diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 541b89f26..8fcd84206 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -669,7 +669,7 @@ class AdminProductsControllerCore extends AdminController { $productId = (int)Tools::getValue('id_product'); @unlink(_PS_TMP_IMG_DIR_.'product_'.$productId.'.jpg'); - @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$productId.'.jpg'); + @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$productId.'_'.$this->context->shop->id.'.jpg'); $this->redirect_after = self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(Tools::getIsset('id_category') ? '&id_category='.(int)Tools::getValue('id_category') : '').'&action=Images&addproduct'.'&token='.$this->token; } } @@ -1348,7 +1348,7 @@ class AdminProductsControllerCore extends AdminController 'shops' => $json_shops, ); @unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$obj->id_product.'.jpg'); - @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$obj->id_product.'.jpg'); + @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$obj->id_product.'_'.$this->context->shop->id.'.jpg'); die(Tools::jsonEncode($json)); } else @@ -1520,7 +1520,7 @@ class AdminProductsControllerCore extends AdminController $img->cover = 1; @unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$img->id_product.'.jpg'); - @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$img->id_product.'.jpg'); + @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$img->id_product.'_'.$this->context->shop->id.'.jpg'); if ($img->update()) $this->jsonConfirmation($this->_conf[26]); @@ -1556,8 +1556,8 @@ class AdminProductsControllerCore extends AdminController if (file_exists(_PS_TMP_IMG_DIR_.'product_'.$image->id_product.'.jpg')) $res &= @unlink(_PS_TMP_IMG_DIR_.'product_'.$image->id_product.'.jpg'); - if (file_exists(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'.jpg')) - $res &= @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'.jpg'); + if (file_exists(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'_'.$this->context->shop->id.'.jpg')) + $res &= @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'_'.$this->context->shop->id.'.jpg'); if ($res) $this->jsonConfirmation($this->_conf[7]); @@ -1646,7 +1646,7 @@ class AdminProductsControllerCore extends AdminController if (count($this->errors)) return false; @unlink(_PS_TMP_IMG_DIR_.'product_'.$product->id.'.jpg'); - @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$product->id.'.jpg'); + @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$product->id.'_'.$this->context->shop->id.'.jpg'); return ((isset($id_image) && is_int($id_image) && $id_image) ? $id_image : false); } /**