This commit is contained in:
2026-03-28 11:33:56 +01:00
parent 412e235512
commit aa8e21862d
132 changed files with 24381 additions and 10882 deletions

View File

@@ -437,7 +437,7 @@ class ProductsApiController
// String fields — direct mapping
$stringFields = [
'sku', 'ean', 'custom_label_0', 'custom_label_1', 'custom_label_2',
'custom_label_3', 'custom_label_4', 'wp',
'custom_label_3', 'custom_label_4', 'wp', 'new_to_date', 'additional_message_text',
];
foreach ($stringFields as $field) {
if (isset($body[$field])) {
@@ -447,6 +447,18 @@ class ProductsApiController
}
}
if (isset($body['additional_message'])) {
$d['additional_message'] = !empty($body['additional_message']) ? 'on' : '';
} elseif ($existing !== null) {
$d['additional_message'] = !empty($existing['additional_message']) ? 'on' : '';
}
if (isset($body['additional_message_required'])) {
$d['additional_message_required'] = !empty($body['additional_message_required']) ? 'on' : '';
} elseif ($existing !== null) {
$d['additional_message_required'] = !empty($existing['additional_message_required']) ? 'on' : '';
}
// Foreign keys
if (isset($body['set_id'])) {
$d['set'] = $body['set_id'];