Fixed element14 barcode to part logic, when barcode not contain SKU

This commit is contained in:
Jan Böhmer 2026-08-02 14:02:15 +02:00
parent e11eff5e45
commit bc6a4004b5
2 changed files with 3 additions and 2 deletions

View file

@ -296,7 +296,8 @@ class Element14Provider implements InfoProviderInterface, URLHandlerInfoProvider
{
$tmp = $this->queryByTerm('id:' . $id);
if (count($tmp) === 0) {
throw new \RuntimeException('No part found with ID ' . $id);
//Try to search by MPN, as some parts are not found by ID, but by MPN
$tmp = $this->queryByTerm('any:' . $id);
}
if (count($tmp) > 1) {

View file

@ -355,7 +355,7 @@ final readonly class BarcodeScanResultHandler
];
}
// Element14: can use supplierPartNumber directly
// Element14: can use supplierPartNumber directly, as the Element14Provider will try to resolve it to a SKU number if necessary
if ($vendor === 'element14') {
return [
'providerKey' => 'element14',