30 $productIds = $this->getProductIdsByBarcode($searchQuery->
getQuery());
36 $productIds = array_unique($productIds);
39 foreach ($products as $key => $product)
41 $elementMap[$product[
'ID']][] = $key;
44 if (!empty($products))
46 $barcodeRaw = \Bitrix\Catalog\StoreBarcodeTable::getList([
48 '=PRODUCT_ID' => $productIds,
49 'BARCODE' => $searchQuery->
getQuery() .
'%'
51 'select' => [
'BARCODE',
'PRODUCT_ID']
54 while ($barcode = $barcodeRaw->fetch())
56 $productId = $barcode[
'PRODUCT_ID'];
57 if (!isset($elementMap[$productId]))
62 foreach ($elementMap[$productId] as $key)
64 $products[$key][
'BARCODE'] = $barcode[
'BARCODE'];
68 foreach ($products as $product)