Skip to content

Commit

Permalink
MSI-3110-In-Store-Pickup-delivery-not-available-for-order-with-Config…
Browse files Browse the repository at this point in the history
…urable-product.

Fix issue of In-Store Pikcup availability with composite products.
Fix issue of In-Store Pickup availability with repeatable SKUs.
  • Loading branch information
oleksandrkravchuk committed Jul 2, 2020
1 parent 8aa3b30 commit 5861ff3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public function resolve(
$extensionAttributes = $searchRequest->getExtensionAttributes();
$skus = [];
foreach ($extensionAttributes->getProductsInfo() as $item) {
$skus[] = $item->getSku();
if (!in_array($item->getSku(), $skus)) {
$skus[] = $item->getSku();
}
}

$codes = $this->getPickupLocationIntersectionForSkus->execute($skus);
Expand Down
6 changes: 6 additions & 0 deletions InventoryInStorePickupApi/Test/Api/GetPickupLocationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ public function executeIntersectionSearchDataProvider(): array
[
'sku' => 'SKU-3',
],
[
'sku' => 'SKU-3',
],
[
'sku' => 'SKU-3',
],
],
],
'scopeType' => 'website',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ private function getSearchRequestExtension(array $items): SearchRequestExtension
{
$productsInfo = [];
foreach ($items as $item) {
if (!empty($item->getChildren())) {
continue;
}

$productsInfo[] = $this->productInfoFactory->create(['sku' => $item->getSku()]);
}

Expand Down

0 comments on commit 5861ff3

Please sign in to comment.