Skip to content

Commit

Permalink
Merge pull request Eoxia#37 from evarisk-charles/fix_function_19
Browse files Browse the repository at this point in the history
Eoxia#36 [Hook] fix: function not available in v18 dolibarr
  • Loading branch information
nicolas-eoxia authored Aug 29, 2024
2 parents f86ee60 + cdcf762 commit 471592f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions class/actions_priseo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ public function completeTabsHead(array $parameters): int
require_once __DIR__ . '/competitorprice.class.php';

$competitorPrice = new CompetitorPrice($this->db);
$competitorPrices = $competitorPrice->getCountOfItemsLinkedByObjectID($parameters['object']->id, 'status >= 0 AND fk_product', $competitorPrice->table_element);
$parameters['head'][$headKey][1] .= '<span class="badge marginleftonlyshort">' . (max($competitorPrices, 0)) . '</span>';
$competitorPrices = $competitorPrice->fetchAll('', '', 0, 0, ['customsql' => 't.status >= 0 AND t.fk_product = ' . $parameters['object']->id]);
if (is_array($competitorPrices) && !empty($competitorPrices)) {
$parameters['head'][$headKey][1] .= '<span class="badge marginleftonlyshort">' . count($competitorPrices) . '</span>';
}
}
}
}
Expand Down

0 comments on commit 471592f

Please sign in to comment.