render = $render; $this->productCollectionFactory = $productCollectionFactory; $this->isNeedRenderPrice = $isNeedRenderPrice; $this->helper = $helper; $this->configProvider = $configProvider; } public function execute(array $productsData): array { $ids = array_column($productsData, 'entity_id'); $collection = $this->productCollectionFactory->create(); $collection->addIdFilter($ids); foreach ($collection as $product) { $id = $product->getEntityId(); if (!$this->isNeedRenderPrice->execute($product, [])) { $productsData[$id]['price'] = $this->helper->getNewPriceHtmlBox($product); } $isApplied = $this->helper->isApplied($product); $productsData[$id][self::IS_COMPARE_ALLOWED] = !($this->configProvider->isHideCompare() && $isApplied); $productsData[$id][self::IS_WISHLIST_ALLOWED] = !($this->configProvider->isHideWishlist() && $isApplied); $productsData[$id][self::IS_ADD_TO_CART_ALLOWED] = !($this->configProvider->isHideAddToCart() && $isApplied); } return $productsData; } }