From 05234b659cdb7fee698b74e28217e129c7259781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hlav=C3=A1=C4=8Dek?= Date: Thu, 23 Nov 2023 16:12:01 +0100 Subject: [PATCH] Fallback on a previous version of constant --- dashproducts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashproducts.php b/dashproducts.php index 8f43848..0d11b29 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -231,7 +231,7 @@ public function getTableBestSellers($date_from, $date_to) $img = ''; if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image']) { $image = new Image((int) $row_image['id_image']); - $path_to_image = _PS_PROD_IMG_DIR_ . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; + $path_to_image = (defined('_PS_PRODUCT_IMG_DIR_') ? _PS_PRODUCT_IMG_DIR_ : _PS_PROD_IMG_DIR_) . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; $img = ImageManager::thumbnail($path_to_image, 'product_mini_' . $row_image['id_image'] . '.' . $this->context->controller->imageType, 45, $this->context->controller->imageType); } @@ -326,7 +326,7 @@ public function getTableMostViewed($date_from, $date_to) $img = ''; if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image']) { $image = new Image((int) $row_image['id_image']); - $path_to_image = _PS_PROD_IMG_DIR_ . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; + $path_to_image = (defined('_PS_PRODUCT_IMG_DIR_') ? _PS_PRODUCT_IMG_DIR_ : _PS_PROD_IMG_DIR_) . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; $img = ImageManager::thumbnail( $path_to_image, 'product_mini_' . $product_obj->id . '.' . $this->context->controller->imageType,