22 $this->productIdLocator = $productIdLocator;
36 $idsBySku = $this->productIdLocator->retrieveProductIdsBySkus(
$skus);
37 $existingSkus = array_keys($idsBySku);
38 $skuDiff = array_udiff(
44 foreach ($idsBySku as $sku => $ids) {
45 foreach ($ids as
$type) {
46 $valueTypeIsAllowed =
false;
48 if ($allowedPriceTypeValue
50 && $this->productRepository->get($sku)->getPriceType() != $allowedPriceTypeValue
52 $valueTypeIsAllowed =
true;
55 if (!in_array(
$type, $allowedProductTypes) || $valueTypeIsAllowed) {
73 public function filterSkuList(array
$skus, array $allowedProductTypes, $allowedPriceTypeValue =
null)
76 return array_diff(
$skus, $failedItems);
filterSkuList(array $skus, array $allowedProductTypes, $allowedPriceTypeValue=null)
foreach($websiteCodes as $websiteCode) $skus
retrieveInvalidSkuList(array $skus, array $allowedProductTypes, $allowedPriceTypeValue=null)
__construct(\Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository)