File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
public_html/admin/model/catalog Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments