Skip to content

Commit 772fce9

Browse files
committed
admin: quantity discount quick-save fix (FID-143)
1 parent b02986e commit 772fce9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

public_html/admin/model/catalog/product.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,15 @@ public function updateProductDiscount($product_discount_id, $data)
422422
}
423423
$update = [];
424424
foreach ($fields as $f) {
425-
$newValue = $data[$f];
426-
if(str_starts_with($f, 'date_')){
427-
$newValue = "DATE('".$newValue."')";
428-
}else{
429-
$newValue = "'".$this->db->escape($data[$f])."'";
425+
if(isset($data[$f])) {
426+
$newValue = $data[$f];
427+
if (str_starts_with($f, 'date_')) {
428+
$newValue = "DATE('" . $newValue . "')";
429+
} else {
430+
$newValue = "'" . $this->db->escape($data[$f]) . "'";
431+
}
432+
$update[] = $f . " = " . $newValue;
430433
}
431-
$update[] = $f . " = " . $newValue;
432434
}
433435
if (!empty($update)) {
434436
$this->db->query(

0 commit comments

Comments
 (0)