Skip to content

Commit

Permalink
Merge pull request #1 from pepijnblom/master
Browse files Browse the repository at this point in the history
Fix `The product that was requested doesn't exist.`
  • Loading branch information
pepijnblom authored Nov 13, 2023
2 parents f1651e9 + 466cdcb commit 6715bfb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public function getProductBySku(string $sku, int $storeId): object
public function getAttributesBySku(string $sku): array
{
$storeId = $this->storeManager->getStore()->getId();
$product = $this->getProductBySku($sku, $storeId);
try{
$product = $this->getProductBySku($sku, $storeId);
}catch (\Throwable $e){
return [];
}
$attributes = $product->getAttributes();

$attributeData = [];
Expand Down

0 comments on commit 6715bfb

Please sign in to comment.