/** * @param \Magento\Catalog\Api\CategoryManagementInterface $categoryReadService * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\Collection $productCollection */ public function __construct(\Magento\Catalog\Api\CategoryManagementInterface $categoryReadService, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory, \Magento\Catalog\Model\Resource\Product\Collection $productCollection) { $this->categoryReadService = $categoryReadService; $this->eavConfig = $eavConfig; $this->attributeCollectionFactory = $attributeCollectionFactory; $this->attrOptionCollectionFactory = $attrOptionCollectionFactory; $this->productCollection = $productCollection->removeAllItems()->clear()->addAttributeToSelect('sku'); }