Skip to content

Commit

Permalink
Merge pull request #55 from Hlavtox/fallback-constant
Browse files Browse the repository at this point in the history
Fallback on a previous version of constant
  • Loading branch information
Hlavtox authored Nov 23, 2023
2 parents 112cb66 + 05234b6 commit 17c26aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dashproducts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 17c26aa

Please sign in to comment.