justifiedjt90 Posted December 22, 2015 Share Posted December 22, 2015 Hello, I have a problem with my online shop, in back office exactly. I cannot cancel orders! I tried finding a solution, but nothing. And the strangest thing was i discovered this when i had to cancel two orders i had. I went to the orders, canceled the first, it was alright. No error, it worked. Then found the second one, clicked cancel order and error! Ok try again I said, cancel order, Error! So i don't know what happened but since then i cannot cancel orders. I would appreciate if you guys could help me out. Here is the error message: [PrestaShopException]Property StockAvailable->id_product_attribute is emptyat line 909 in file classes/ObjectModel.php 904. }905.906. $message = $this->validateField($field, $this->$field);907. if ($message !== true) {908. if ($die) {909. throw new PrestaShopException($message);910. }911. return $error_return ? $message : false;912. }913. }914. ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 652 - classes/ObjectModel.php] ObjectModelCore->update - [line 406 - classes/stock/StockAvailable.php] - [1 Arguments] StockAvailableCore->update - [line 128 - Core/Business/Stock/Core_Business_Stock_StockManager.php] Core_Business_Stock_StockManager->updateQuantity - [line 472 - classes/stock/StockAvailable.php] - [4 Arguments] StockAvailableCore::updateQuantity - [line 214 - classes/order/OrderHistory.php] - [4 Arguments] OrderHistoryCore->changeIdOrderState - [line 531 - controllers/admin/AdminOrdersController.php] - [3 Arguments] AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - admin/index.php] Link to comment Share on other sites More sharing options...
justifiedjt90 Posted December 22, 2015 Author Share Posted December 22, 2015 For everyone with the same problem I'll post here what helped me solve it. Search for file Core/Business/Stock/Core_Business_Stock_StockManager.php . At line 126 I had: $stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity;$stockAvailable->id_product = (int)$product->id;$stockAvailable->update(); The problem is that is not correct. It must look like this: $stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity;$stockAvailable->id_product = (int)$product->id;$stockAvailable->id_product_attribute = (int)$id_product_attribute;$stockAvailable->update(); More to the point line $stockAvailable->id_product_attribute = (int)$id_product_attribute; was missing. Hope this helps! 3 Link to comment Share on other sites More sharing options...
Steve360 Posted January 21, 2016 Share Posted January 21, 2016 It works, great! Thank you very much Steve Link to comment Share on other sites More sharing options...
motion2082 Posted February 1, 2016 Share Posted February 1, 2016 Having the same issue but your fix did not work for me Link to comment Share on other sites More sharing options...
catzarov Posted March 10, 2016 Share Posted March 10, 2016 I use 1.6.1.4 and have the same problem. With your help i fix this problem with order status. BIG THANKS Link to comment Share on other sites More sharing options...
adtastic Posted June 6, 2016 Share Posted June 6, 2016 I have 1.6.1.1 and have applied the above fix. still cannot cancel an order. get this error: [PrestaShopException]Property StockAvailable->id_product_attribute is emptyat line 909 in file classes/ObjectModel.php904. }905.906. $message = $this->validateField($field, $this->$field);907. if ($message !== true) {908. if ($die) {909. throw new PrestaShopException($message);910. }911. return $error_return ? $message : false;912. }913. }914. ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 652 - classes/ObjectModel.php] ObjectModelCore->update - [line 406 - classes/stock/StockAvailable.php] - [1 Arguments] StockAvailableCore->update - [line 128 - Core/Business/Stock/Core_Business_Stock_StockManager.php] Core_Business_Stock_StockManager->updateQuantity - [line 472 - classes/stock/StockAvailable.php] - [4 Arguments] StockAvailableCore::updateQuantity - [line 206 - classes/order/OrderHistory.php] - [4 Arguments] OrderHistoryCore->changeIdOrderState - [line 531 - controllers/admin/AdminOrdersController.php] - [3 Arguments] AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - admin/index.php] Link to comment Share on other sites More sharing options...
adtastic Posted June 7, 2016 Share Posted June 7, 2016 anyone have any ideas on this? Really need to be able to cancel orders and seems there is a bug here. Link to comment Share on other sites More sharing options...
netamis Posted June 15, 2016 Share Posted June 15, 2016 Big Thank you , it's works. Link to comment Share on other sites More sharing options...
Inford Posted March 20, 2017 Share Posted March 20, 2017 Same problem as occured. when i update order status "canceled " it shows error. the error like : This page isn’t workingwww.hindhome.com is currently unable to handle this request. HTTP ERROR 500 any ONE CAN HELP ME ? Currently i am using prestashop 1.7.0.3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now