Use strict alias mapping for article-to-product components

This commit is contained in:
2026-03-30 08:18:05 +02:00
parent ef06b4dd90
commit d2943b446b

View File

@@ -1471,30 +1471,6 @@ try {
$lineTotal = $unitPrice !== null ? round($qty * $unitPrice, 2) : null; $lineTotal = $unitPrice !== null ? round($qty * $unitPrice, 2) : null;
$sellableItemId = resolve_sellable_item_id($pdo, $articleNumber, $title); $sellableItemId = resolve_sellable_item_id($pdo, $articleNumber, $title);
$autoMappingMeta = null; $autoMappingMeta = null;
if ($sellableItemId === null) {
$inferredComponents = infer_components_from_title($pdo, $title);
if ($inferredComponents !== []) {
$autoMappingMeta = ensure_sellable_mapping_from_title_components(
$pdo,
$articleNumber,
$title,
$inferredComponents
);
$sellableItemId = (int) $autoMappingMeta['sellableItemId'];
}
}
if ($sellableItemId === null) {
$fallbackProductId = resolve_product_id_fallback($pdo, $articleNumber, $title);
if ($fallbackProductId !== null) {
$autoMappingMeta = ensure_sellable_mapping_from_product_fallback(
$pdo,
$fallbackProductId,
'',
$title
);
$sellableItemId = (int) $autoMappingMeta['sellableItemId'];
}
}
$lineNo = $index + 1; $lineNo = $index + 1;
$lineInsert->execute([ $lineInsert->execute([