Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #48 from roihunter/fix-empty-default-category
Browse files Browse the repository at this point in the history
GSTV-649 Don't call translateCategory when the idCategory is empty
  • Loading branch information
oparizek authored Sep 4, 2019
2 parents e5823f3 + 01650c9 commit 9b325bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions classes/ProductJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ private function getSingleProduct($id_product, $id_lang)

private function getProductDefaultCategory($idCategory, $idLanguage)
{
if (!isset($this->categoryCache[$idCategory])) {
if ($idCategory && !isset($this->categoryCache[$idCategory])) {
$this->categoryCache[$idCategory] = $this->translateCategory($idCategory, $idLanguage);
}
return empty($this->categoryCache[$idCategory]) ? "" : $this->categoryCache[$idCategory];
return !$idCategory || empty($this->categoryCache[$idCategory]) ? "" : $this->categoryCache[$idCategory];
}

private function translateCategory($idCategory, $idLanguage)
Expand Down
2 changes: 1 addition & 1 deletion roihunter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct()
{
$this->name = 'roihunter';
$this->tab = 'advertising_marketing';
$this->version = '1.2.0';
$this->version = '1.2.1';
$this->author = 'ROI Hunter';
$this->need_instance = 1;
$this->bootstrap = true;
Expand Down

0 comments on commit 9b325bf

Please sign in to comment.