Link to site: www.maupertuus.net
Multi language: (Dutch / English).
I have modified the file:
storage..../modification/admin/view/template/catalog/product_form.twig
Code: Select all
105 <div class="tab-pane" id="tab-data">
106 <div class="form-group required">
107 <label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
108 <div class="col-sm-10">
109 <input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control" />
110 {% if error_model %}
111 <div class="text-danger">{{ error_model }}</div>
112 {% endif %}</div>
113 </div>
114 <!-- <div class="form-group">
115 <label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="{{ help_sku }}">{{ entry_sku }}</span></label>
116 <div class="col-sm-10">
117 <input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control" />
118 </div>
119 </div>
120 <div class="form-group">
121 <label class="col-sm-2 control-label" for="input-upc"><span data-toggle="tooltip" title="{{ help_upc }}">{{ entry_upc }}</span></label>
122 <div class="col-sm-10">
123 <input type="text" name="upc" value="{{ upc }}" placeholder="{{ entry_upc }}" id="input-upc" class="form-control" />
124 </div>
125 </div>
126 <div class="form-group">
127 <label class="col-sm-2 control-label" for="input-ean"><span data-toggle="tooltip" title="{{ help_ean }}">{{ entry_ean }}</span></label>
128 <div class="col-sm-10">
129 <input type="text" name="ean" value="{{ ean }}" placeholder="{{ entry_ean }}" id="input-ean" class="form-control" />
130 </div>
131 </div>
132 <div class="form-group">
133 <label class="col-sm-2 control-label" for="input-jan"><span data-toggle="tooltip" title="{{ help_jan }}">{{ entry_jan }}</span></label>
134 <div class="col-sm-10">
135 <input type="text" name="jan" value="{{ jan }}" placeholder="{{ entry_jan }}" id="input-jan" class="form-control" />
136 </div>
137 </div>
138 <div class="form-group">
139 <label class="col-sm-2 control-label" for="input-isbn"><span data-toggle="tooltip" title="{{ help_isbn }}">{{ entry_isbn }}</span></label>
140 <div class="col-sm-10">
141 <input type="text" name="isbn" value="{{ isbn }}" placeholder="{{ entry_isbn }}" id="input-isbn" class="form-control" />
142 </div>
143 </div> -->
144 <div class="form-group">
145 <label class="col-sm-2 control-label" for="input-mpn"><span data-toggle="tooltip" title="{{ help_mpn }}">{{ entry_mpn }}</span></label>
146 <div class="col-sm-10">
147 <input type="text" name="mpn" value="{{ mpn }}" placeholder="{{ entry_mpn }}" id="input-mpn" class="form-control" />
148 </div>
149 </div>
150 <div class="form-group">
151 <label class="col-sm-2 control-label" for="input-location">{{ entry_location }}</label>
152 <div class="col-sm-10">
153 <input type="text" name="location" value="{{ location }}" placeholder="{{ entry_location }}" id="input-location" class="form-control" />
154 </div>
155 </div>
156
Code: Select all
227 <div class="form-group">
228 <label class="col-sm-2 control-label" for="input-stock-status"><span data-toggle="tooltip" title="{{ help_stock_status }}">{{ entry_stock_status }}</span></label>
229 <div class="col-sm-10">
230 <select name="stock_status_id" id="input-stock-status" class="form-control">
231
232
233 {% for stock_status in stock_statuses %}
234 {% if stock_status.stock_status_id == stock_status_id %}
235
236
237 <option value="{{ stock_status.stock_status_id }}" selected="selected">{{ stock_status.name }}</option>
238
239
240 {% else %}
241
242
243 <option value="{{ stock_status.stock_status_id }}">{{ stock_status.name }}</option>
244
245
246 {% endif %}
247 {% endfor %}
248
249
250 </select>
251 </div>
252 </div>
253 <div class="form-group">
254 <label class="col-sm-2 control-label">{{ entry_shipping }}</label>
255 <div class="col-sm-10">
256 <label class="radio-inline"> {% if shipping %}
257 <input type="radio" name="shipping" value="1" checked="checked" />
258 {{ text_yes }}
259 {% else %}
260 <input type="radio" name="shipping" value="1" />
261 {{ text_yes }}
262 {% endif %} </label>
263 <label class="radio-inline"> {% if not shipping %}
264 <input type="radio" name="shipping" value="0" checked="checked" />
265 {{ text_no }}
266 {% else %}
267 <input type="radio" name="shipping" value="0" />
268 {{ text_no }}
269 {% endif %} </label>
270 </div>
271 </div>
272 <div class="form-group">
273 <label class="col-sm-2 control-label" for="input-date-available">{{ entry_date_available }}</label>
274 <div class="col-sm-3">
275 <div class="input-group date">
276 <input type="text" name="date_available" value="{{ date_available }}" placeholder="{{ entry_date_available }}" data-date-format="YYYY-MM-DD" id="input-date-available" class="form-control" />
277 <span class="input-group-btn">
278 <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
279 </span></div>
280 </div>
281 </div>
282 <!-- <div class="form-group">
283 <label class="col-sm-2 control-label" for="input-length">{{ entry_dimension }}</label>
284 <div class="col-sm-10">
285 <div class="row">
286 <div class="col-sm-4">
287 <input type="text" name="length" value="{{ length }}" placeholder="{{ entry_length }}" id="input-length" class="form-control" />
288 </div>
289 <div class="col-sm-4">
290 <input type="text" name="width" value="{{ width }}" placeholder="{{ entry_width }}" id="input-width" class="form-control" />
291 </div>
292 <div class="col-sm-4">
293 <input type="text" name="height" value="{{ height }}" placeholder="{{ entry_height }}" id="input-height" class="form-control" />
294 </div>
295 </div>
296 </div>
297 </div> -->
298 <div class="form-group">
299 <label class="col-sm-2 control-label" for="input-length-class">{{ entry_length_class }}</label>
300 <div class="col-sm-10">
301 <select name="length_class_id" id="input-length-class" class="form-control">
302
303
304 {% for length_class in length_classes %}
305 {% if length_class.length_class_id == length_class_id %}
306
307
308 <option value="{{ length_class.length_class_id }}" selected="selected">{{ length_class.title }}</option>
309
310
311 {% else %}
312
313
314 <option value="{{ length_class.length_class_id }}">{{ length_class.title }}</option>
315
316
317 {% endif %}
318 {% endfor %}
319
320
321 </select>
322 </div>
323 </div>
324 <div class="form-group">
325 <label class="col-sm-2 control-label" for="input-weight">{{ entry_weight }}</label>
326 <div class="col-sm-10">
327 <input type="text" name="weight" value="{{ weight }}" placeholder="{{ entry_weight }}" id="input-weight" class="form-control" />
328 </div>
329 </div>
330 <div class="form-group">
331 <label class="col-sm-2 control-label" for="input-weight-class">{{ entry_weight_class }}</label>
332 <div class="col-sm-10">
333 <select name="weight_class_id" id="input-weight-class" class="form-control">
334
335
336 {% for weight_class in weight_classes %}
337 {% if weight_class.weight_class_id == weight_class_id %}
338
339
340 <option value="{{ weight_class.weight_class_id }}" selected="selected">{{ weight_class.title }}</option>
341
342
343 {% else %}
344
345
346 <option value="{{ weight_class.weight_class_id }}">{{ weight_class.title }}</option>
347
348
349 {% endif %}
350 {% endfor %}
351
352
353 </select>
354 </div>
355 </div>
356 <div class="form-group">
357 <label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
358 <div class="col-sm-10">
359 <select name="status" id="input-status" class="form-control">
360
361
362 {% if status %}
363
364
365 <option value="1" selected="selected">{{ text_enabled }}</option>
366 <option value="0">{{ text_disabled }}</option>
367
368
369 {% else %}
370
371
372 <option value="1">{{ text_enabled }}</option>
373 <option value="0" selected="selected">{{ text_disabled }}</option>
374
375
376 {% endif %}
377
378
379 </select>
380 </div>
381 </div>
382 <div class="form-group">
383 <label class="col-sm-2 control-label" for="input-sort-order">{{ entry_sort_order }}</label>
384 <div class="col-sm-10">
385 <input type="text" name="sort_order" value="{{ sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control" />
386 </div>
387 </div>
388 </div>
If I edit a product, the error log contains the following errors:
2021-04-20 14:19:20 - PHP Notice: Undefined index: sku in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: upc in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: ean in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: jan in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: isbn in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: length in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: width in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: height in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
File storage.../modification/admin/model/catalog/product.php on line 146 contins the following:
Code: Select all
146 $this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = empty('" . $this->db->escape($data['sku']) . "'), upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . (int)$data['tax_class_id'] . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");
If tried this:
sku = empty('" . $this->db->escape($data['sku']) . "')
and then I get an error page in the browser (see attachment)
and tried this:
sku = '" . empty($this->db->escape($data['sku'])) . "'
and this gives the same error in the error log.
Can anyone help me with the right adjustments (right syntax)? Please keep in mind I'm not a programmer.
Thanks in advance...