Get products

@return string[]
508393
public function getProducts()
    {
        return $this->filterDuplicates(array_merge([
            $this->originProduct,
            $this->product,
            preg_replace('/[^A-Za-z0-9]/', '', $this->product), // in case of special characters
        ],
            $this->explode($this->product, '-')
        ));
    }
1039225
public function getProductNames()
    {
        $items = $this->getOrder()->getAllItems();
        $productNames = [];
        foreach ($items as $item) {
            if ($item->getParentItemId() === null) {
                $productNames[] = str_replace('"', ' ', $item->getName());
            }
        }
        return json_encode($productNames);
    }
427821
public function getItems(): array
    {
        $available = [];
        $assigned = [];

        foreach (array_keys($this->manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        foreach ($this->manager->getAssignments($this->userId) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

        return [
            'available' => $available,
            'assigned' => $assigned,
        ];
    }
181570
function getFits()
    {
        if (!is_null($this->fits)) {
            return $this->fits;
        }
        if ($productId = (int)$this->getId()) {
            $this->fits = $this->doGetFits($productId);
            return $this->fits;
        }
        return array();
    }
750298
protected function getCustomSortingList() : array
    {
        $arEventResult = Event::fire('shopaholic.sorting.offer.get.list', [$this->sValue]);
        if (empty($arEventResult)) {
            return [];
        }

        $arElementIDList = [];
        foreach ($arEventResult as $arEventOfferIDList) {
            if (empty($arEventOfferIDList) || !is_array($arEventOfferIDList)) {
                continue;
            }

            $arElementIDList = $arEventOfferIDList;
            break;
        }

        return $arElementIDList;
    }
525673
protected function getCustomSortingList() : array
    {
        $arEventResult = Event::fire('shopaholic.sorting.get.list', [$this->sValue]);
        if (empty($arEventResult)) {
            return [];
        }

        $arElementIDList = [];
        foreach ($arEventResult as $arEventProductIDList) {
            if (empty($arEventProductIDList) || !is_array($arEventProductIDList)) {
                continue;
            }

            $arElementIDList = $arEventProductIDList;
            break;
        }

        return $arElementIDList;
    }
921729
public function getBasketProducts()
    {
        return array_map(
            function($item) {
                $item['params'] = Json::decode($item['params']);
                return $item;
            },
            $this->find()
            ->where([
                'id_user' => $this->idUser,
                'storage' => $this->owner->storageName
            ])
            ->asArray()
            ->all()
        );
    }
66198
private function getSortedProducts()
    {
        $products   = [];
        $productIds = $this->getSortedProductIds();

        if ($productIds && count($productIds)) {
            $productCollection = $this->getProductCollection()->setPageSize(count($productIds));

            $idFilterParams = ['values' => $productIds, 'field' => 'entity_id'];
            $idFilter       = $this->queryFactory->create(QueryInterface::TYPE_TERMS, $idFilterParams);
            $productCollection->addQueryFilter($idFilter);

            $products = $productCollection->getItems();
        }

        $sortedProducts = [];

        foreach ($this->getSortedProductIds() as $productId) {
            if (isset($products[$productId])) {
                $sortedProducts[$productId] = $products[$productId];
            }
        }

        return $sortedProducts;
    }
52027
private function getQuoteProducts()
    {
        $products = [];
        $params = $this->_request->getParams();

        if (! isset($params['quote_id']) || ! isset($params['code']) || ! $this->helper->isCodeValid($params['code'])) {
            $this->helper->log('Feefo no quote id or code is set');

            return $products;
        }

        $quoteId = (int) $params['quote_id'];

        $quoteModel = $this->quoteFactory->create();
        $this->quoteResource->load($quoteModel, $quoteId);

        if (! $quoteModel->getId()) {
            return $products;
        }

        $productCollection = $this->review->getProductCollection($quoteModel);

        foreach ($productCollection as $product) {
                $products[$product->getSku()] = $product->getName();
        }
        return $products;
    }
1227239
public function getLoadedProductCollection()
    {
        $params = $this->getRequest()->getParams();
        //check for param code and id
        if (! isset($params['customer_id']) ||
            ! isset($params['code']) ||
            ! $this->helper->isCodeValid($params['code'])
        ) {
            $this->helper->log('Recently viewed no id or valid code is set');
            return [];
        }

        $productsToDisplay = [];
        $mode = $this->getRequest()->getActionName();
        $customerId = (int) $this->getRequest()->getParam('customer_id');
        $limit = (int) $this->recommnededHelper->getDisplayLimitByMode($mode);

        //login customer to receive the recent products
        $session = $this->sessionFactory->create();
        $isLoggedIn = $session->loginById($customerId);
        $productIds = $this->catalog->getRecentlyViewed($customerId, $limit);

        //get product collection to check for salable
        $productCollection = $this->catalog->getProductCollectionFromIds($productIds);

        //show products only if is salable
        foreach ($productCollection as $product) {
            if ($product->isSalable()) {
                $productsToDisplay[$product->getId()] = $product;
            }
        }
        $this->helper->log(
            'Recentlyviewed customer  : ' . $customerId . ', mode ' . $mode
            . ', limit : ' . $limit .
            ', items found : ' . count($productIds) . ', is customer logged in : '
            . $isLoggedIn . ', products :' . count($productsToDisplay)
        );

        $session->logout();

        return $productsToDisplay;
    }
399837
public function getProductCollection($quote)
    {
        $productIds = [];
        $products = [];
        $items = $quote->getAllVisibleItems();

        //get the product ids for the collection
        foreach ($items as $item) {
            $productIds[] = $item->getProductId();
        }

        if (! empty($productIds)) {
            $products = $this->productCollection->create()
                ->addAttributeToSelect('*')
                ->addFieldToFilter('entity_id', ['in' => $productIds]);
        }

        return $products;
    }
1369270
public static function get()
    {
        return [
            self::$equals,
            self::$lessThan,
            self::$lessThanEqualTo,
            self::$greaterThan,
            self::$greaterThanEqualTo,
            self::$doesNotEqual,
            self::$doesNotEqualAlt,
            self::$is,
            self::$isA,
            self::$isNot,
            self::$like,
        ];
    }
518248
protected function getListProductClass()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return (array) $this->product_class->getList($conditions);
    }
1149005
public function getItemsArray()
    {
        $items = [];

        foreach ($this->getItems() as $item) {
            $items[] = [
                'id'   => $item->getId(),
                'text' => $item->getText(),
            ];
        }

        return $items;
    }
1365179
public function getLoadedProductCollection()
    {
        $params = $this->getRequest()->getParams();
        if (! isset($params['code']) || ! $this->helper->isCodeValid($params['code'])) {
            $this->helper->log('Best sellers no valid code is set');
            return [];
        }

        //mode param grid/list
        $mode = $this->getRequest()->getActionName();
        //limit of the products to display
        $limit = $this->recommnededHelper->getDisplayLimitByMode($mode);
        //date range
        $from = $this->recommnededHelper->getTimeFromConfig($mode);
        $to = $this->_localeDate->date()->format(\Zend_Date::ISO_8601);
        $storeId = $this->_storeManager->getStore()->getId();

        return $this->catalog->getBestsellerCollection($from, $to, $limit, $storeId);
    }
170492
public function getTrades(RequestProduct $product) {
        return $this->get(['products', $product->getProductId(), 'trades'], ResponseTrade::class, $product->toArray());
    }
951205
protected function getVatFreeProductsOptions()
    {
        return array(
            PluginConfig::VatFreeProducts_Both => $this->t('option_vatFreeProducts_1'),
            PluginConfig::VatFreeProducts_No => $this->t('option_vatFreeProducts_2'),
            PluginConfig::VatFreeProducts_Only => $this->t('option_vatFreeProducts_3'),
        );
    }