Skip to content

Commit 55a82f4

Browse files
committed
MC-29293: Storefront: Configurable Product with Out Of Stock Child(s)
1 parent 9ef10be commit 55a82f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dev/tests/integration/framework/Magento/TestFramework/ConfigurableProduct/Model/DeleteConfigurableProduct.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ public function execute(string $sku): void
5050
{
5151
$configurableProduct = $this->productRepository->get($sku, false, null, true);
5252
$childrenIds = $configurableProduct->getExtensionAttributes()->getConfigurableProductLinks();
53-
$childrenSkus = $this->productResource->getProductsSku($childrenIds);
54-
$childrenSkus[]['sku'] = $sku;
53+
$childrenSkus = array_column($this->productResource->getProductsSku($childrenIds), 'sku');
54+
$childrenSkus[] = $sku;
5555
$this->registry->unregister('isSecureArea');
5656
$this->registry->register('isSecureArea', true);
57+
5758
foreach ($childrenSkus as $childSku) {
5859
try {
59-
$this->productRepository->deleteById($childSku['sku']);
60+
$this->productRepository->deleteById($childSku);
6061
} catch (NoSuchEntityException $e) {
6162
//product already removed
6263
}
6364
}
65+
6466
$this->registry->unregister('isSecureArea');
6567
$this->registry->register('isSecureArea', false);
6668
}

0 commit comments

Comments
 (0)