Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlavtox committed Nov 6, 2023
1 parent c337b97 commit ebb8f6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/Wrapper/ProductWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public function prepareItemListFromProductList($productList, $useProvidedQuantit
*
* @param array $productIds
*/
private function loadCategories($productIds) {
private function loadCategories($productIds)
{
if (empty($productIds)) {
return;
}
Expand All @@ -94,12 +95,12 @@ private function loadCategories($productIds) {

// Initialize our cache
$this->categories = [];
foreach($productIds as $id) {
foreach ($productIds as $id) {
$this->categories[(int) $id] = [];
}

// Load categories for all products
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
$result = Db::getInstance()->executeS(
'
SELECT cp.`id_category`, cp.`id_product`, cl.`name` FROM `' . _DB_PREFIX_ . 'category_product` cp
LEFT JOIN `' . _DB_PREFIX_ . 'category` c ON (c.id_category = cp.id_category)
Expand Down

0 comments on commit ebb8f6f

Please sign in to comment.