Opencart Undefined index Errors in product

paketonlinestore picture paketonlinestore · Feb 3, 2014 · Viewed 13.9k times · Source

I am using OpenCart 1.4.9 and I have been dealing with Undefined index Errors in product.php recently, I suspect it happens every time the user is creating/input a new product on the dashboard.

How to fix these errors because it makes the server resource overload, my site resource usage peaked at 91% sometimes 100% on the cPanel?

Here is the model file.

Here is the controller file.

Here are the errors I am getting:

PHP Notice: Undefined index: model in /home/xxx/public_html/admin/controller/catalog/product.php on line 651

PHP Notice: Undefined index: sku in /home/xxx/public_html/admin/controller/catalog/product.php on line 659

PHP Notice: Undefined index: location in /home/xxx/public_html/admin/controller/catalog/product.php on line 667

PHP Notice: Undefined index: keyword in /home/xxx/public_html/admin/controller/catalog/product.php on line 687

PHP Notice: Undefined index: image in /home/xxx/public_html/admin/controller/catalog/product.php on line 703

PHP Notice: Undefined index: image in /home/xxx/public_html/admin/controller/catalog/product.php on line 710

PHP Notice: Undefined index: manufacturer_id in /home/xxx/public_html/admin/controller/catalog/product.php on line 723

PHP Notice: Undefined index: shipping in /home/xxx/public_html/admin/controller/catalog/product.php on line 731

PHP Notice: Undefined index: date_available in /home/xxx/public_html/admin/controller/catalog/product.php on line 739

PHP Notice: Undefined index: quantity in /home/xxx/public_html/admin/controller/catalog/product.php on line 747

PHP Notice: Undefined index: minimum in /home/xxx/public_html/admin/controller/catalog/product.php on line 755

PHP Notice: Undefined index: subtract in /home/xxx/public_html/admin/controller/catalog/product.php on line 763

PHP Notice: Undefined index: sort_order in /home/xxx/public_html/admin/controller/catalog/product.php on line 771

PHP Notice: Undefined index: stock_status_id in /home/xxx/public_html/admin/controller/catalog/product.php on line 783

PHP Notice: Undefined index: price in /home/xxx/public_html/admin/controller/catalog/product.php on line 791

PHP Notice: Undefined index: cost in /home/xxx/public_html/admin/controller/catalog/product.php on line 799

PHP Notice: Undefined index: status in /home/xxx/public_html/admin/controller/catalog/product.php on line 807

PHP Notice: Undefined index: tax_class_id in /home/xxx/public_html/admin/controller/catalog/product.php on line 819

PHP Notice: Undefined index: weight in /home/xxx/public_html/admin/controller/catalog/product.php on line 827

PHP Notice: Undefined index: weight_class_id in /home/xxx/public_html/admin/controller/catalog/product.php on line 841

PHP Notice: Undefined index: length in /home/xxx/public_html/admin/controller/catalog/product.php on line 851

PHP Notice: Undefined index: width in /home/xxx/public_html/admin/controller/catalog/product.php on line 859

PHP Notice: Undefined index: height in /home/xxx/public_html/admin/controller/catalog/product.php on line 867

PHP Notice: Undefined index: length_class_id in /home/xxx/public_html/admin/controller/catalog/product.php on line 881

Answer

Sankar V picture Sankar V · Feb 3, 2014

The following are some possibilities:

  1. The fields (listed in your errors) don't exist in your database.

  2. There might be some problem with your product_form.tpl template file.

  3. Check whether the values are getting inserted correctly to the product tables while adding a product.

Comparing the admin product files with a fresh unedited OpenCart 1.4.9 admin product files will help you to find out the issue.