[-] BO : fixed multistore thumbnail on product list

This commit is contained in:
Vincent Augagneur committed 2013-08-12 11:27:25 +02:00
1 parent 6befd831c9
commit 627e3d8a77
2 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -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; $path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)$tr['id_image'] : '').'.'.$this->imageType;
else else
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.Image::getImgFolderStatic($tr['id_image']).(int)$tr['id_image'].'.'.$this->imageType; $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']))) elseif (isset($params['icon']) && isset($tr[$key]) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default'])))
{ {
@@ -669,7 +669,7 @@ class AdminProductsControllerCore extends AdminController
{ {
$productId = (int)Tools::getValue('id_product'); $productId = (int)Tools::getValue('id_product');
@unlink(_PS_TMP_IMG_DIR_.'product_'.$productId.'.jpg'); @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; $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, 'shops' => $json_shops,
); );
@unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$obj->id_product.'.jpg'); @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)); die(Tools::jsonEncode($json));
} }
else else
@@ -1520,7 +1520,7 @@ class AdminProductsControllerCore extends AdminController
$img->cover = 1; $img->cover = 1;
@unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$img->id_product.'.jpg'); @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()) if ($img->update())
$this->jsonConfirmation($this->_conf[26]); $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')) if (file_exists(_PS_TMP_IMG_DIR_.'product_'.$image->id_product.'.jpg'))
$res &= @unlink(_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')) 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.'.jpg'); $res &= @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'_'.$this->context->shop->id.'.jpg');
if ($res) if ($res)
$this->jsonConfirmation($this->_conf[7]); $this->jsonConfirmation($this->_conf[7]);
@@ -1646,7 +1646,7 @@ class AdminProductsControllerCore extends AdminController
if (count($this->errors)) if (count($this->errors))
return false; return false;
@unlink(_PS_TMP_IMG_DIR_.'product_'.$product->id.'.jpg'); @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); return ((isset($id_image) && is_int($id_image) && $id_image) ? $id_image : false);
} }
/** /**