0

I am getting this error when my client tries to update a product in opencart 1.4.9.3:

2011-08-06 13:54:29 - PHP Notice:  Undefined index: quantity in /home/adesignlink/innovativetrailers4less.com/admin/model/catalog/product.php on line 198
2011-08-06 13:54:29 - PHP Notice:  Undefined index: subtract in /home/adesignlink/innovativetrailers4less.com/admin/model/catalog/product.php on line 198
2011-08-06 13:54:29 - PHP Notice:  Undefined index: price in /home/adesignlink/innovativetrailers4less.com/admin/model/catalog/product.php on line 198
2011-08-06 13:54:29 - PHP Notice:  Undefined index: price_full in /home/adesignlink/innovativetrailers4less.com/admin/model/catalog/product.php on line 198
2011-08-06 13:54:29 - PHP Notice:  Undefined index: prefix in /home/adesignlink/innovativetrailers4less.com/admin/model/catalog/product.php on line 198

Here is the model file: http://pastebin.com/VHL4BTLN

Here is the controller file: http://pastebin.com/GT6YsFqt

I know that the form items ARE getting through the controller and into the model but it is not saving all the option info into the db.

Chad P.
  • 11
  • 4
  • It looks like your model and controller are fine... That means it would be malformed code in the view/template... Basically, the template is not passing the quantity, subtract, price, price_full and prefix as part of the product_option_value_data.... I see you modified the module to include "price_full"... Can you post the template? – CarpeNoctumDC Sep 02 '11 at 05:39

1 Answers1

0

There is nothing wrong with neither of these two classes ! Here is what's happening. Your controller calls the editProduct method from your Model class and passes the product id and POST data that comes from your template page. Line 81 in your Controller class:

$this->model_catalog_product->editProduct($this->request->get['product_id'], $this->request->post);

So whatever the problem is, has something to do with your POST request. All the error messages are coming from $product_option_value in that line which is a subarray of $product_option['product_option_value'], and $product_option comes from $data['product_option'] which is $this->request->post. Check your template and see if you are passing the product options correctly. I suggest you to install Xdebug on your server and try to debug the code. simply put a break on like 81 of your controller and check the values.

Tohid
  • 21,535
  • 8
  • 30
  • 43