Skip to content

Commit

Permalink
#100331 Prioritising loading product by sku
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Ortega committed Jul 24, 2023
1 parent 96d306c commit 8daaaa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Model/ImportExport/Processor/Import/Node/Type/Catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ public function getProduct($sku): ?ProductInterface

$product = null;

if (is_numeric($sku)) {
if (!is_numeric($sku)) {
try {
$product = $this->productRepository->getById((int) $sku);
$product = $this->productRepository->get($sku);
} catch (NoSuchEntityException $exception) {
// nothing to do here
}
}

if ($product == null) {
try {
$product = $this->productRepository->get($sku);
$product = $this->productRepository->getById((int) $sku);
} catch (NoSuchEntityException $exception) {
// nothing to do here
}
Expand Down

0 comments on commit 8daaaa1

Please sign in to comment.