don@ptg Posted November 17, 2015 Share Posted November 17, 2015 (edited) There is a thread here that already deals with this but I thought that maybe it had gone unnoticed since the newest version of PrestaShop still has the problem. https://www.prestashop.com/forums/topic/465898-error-al-crear-pedido-manual-solucionado/ The our web site was originally launched on 1.6.1.0. The 1.6.1.1 upgrade broke the payment proccess, and we had the same fault with the upgrade to 1.6.1.2 this morning. We have the USA Epay Module from Presto-Chango installed as our only payment module. When the classes/stock/StockAvailable.php is left as is some products would cause the payment window to hang and the page will never redirect. I turned on developer mode to get this error. Fatal error: Uncaught exception 'PrestaShopException' with message 'Property StockAvailable->id_product_attribute is empty' in /home/ptg/public_html/classes/ObjectModel.php:909 Stack trace: #0 /home/ptg/public_html/classes/ObjectModel.php(246): ObjectModelCore->validateFields() #1 /home/ptg/public_html/classes/ObjectModel.php(652): ObjectModelCore->getFields() #2 /home/ptg/public_html/classes/stock/StockAvailable.php(406): ObjectModelCore->update(false) #3 /home/ptg/public_html/Core/Business/Stock/Core_Business_Stock_StockManager.php(128): StockAvailableCore->update() #4 /home/ptg/public_html/classes/stock/StockAvailable.php(472): Core_Business_Stock_StockManager->updateQuantity(Object(Product), '0', -1, NULL) #5 /home/ptg/public_html/classes/order/OrderDetail.php(473): StockAvailableCore::updateQuantity('577', '0', -1) #6 /home/ptg/public_html/classes/order/OrderDetail.php(638): OrderDetailCore->checkProductStock(Array, '2') #7 /home/ptg/public_html/classes/order/OrderDetail.php(678): OrderDetailCore->create(Object(Order in/home/ptg/public_html/classes/ObjectModel.php on line 909 Replacing the classes/stock/StockAvalible.php file with the one from 1.6.1.0 seems to have solved the problem. For both of the newer versions. It does seem to be fixed, but if this is not the correct way to solve the problem, then I would appreciate the feedback. The other thread is difficult for me to follow since I do not read any other language. Google translate seems to help though. Edited November 17, 2015 by don@ptg (see edit history) Link to comment Share on other sites More sharing options...
Popular Post zmacedoni Posted November 20, 2015 Popular Post Share Posted November 20, 2015 (edited) It is a bug in file Core/Business/Stock/Core_Business_Stock_StockManager.php at line 126 you should have like this: $stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity; $stockAvailable->id_product = (int)$product->id; $stockAvailable->id_product_attribute = (int)$id_product_attribute; $stockAvailable->update(); Edited November 20, 2015 by zmacedoni (see edit history) 14 1 Link to comment Share on other sites More sharing options...
DanieleDR Posted December 9, 2015 Share Posted December 9, 2015 (edited) work!!!!!!!!! zmacedoni you save my life!!! Edited December 9, 2015 by DanieleDR (see edit history) Link to comment Share on other sites More sharing options...
rickczsu Posted December 10, 2015 Share Posted December 10, 2015 I don´t have this folder or file in the core/business folder. Any help? Link to comment Share on other sites More sharing options...
don@ptg Posted December 11, 2015 Author Share Posted December 11, 2015 I don´t have this folder or file in the core/business folder. Any help? I looked in our live site and the downloaded version and the folders and file is there. I am still using the solution I stated in the first post and our site is processing $6000 - $12000 USD a day in sales. I do plan on using Zmacedoni's kind fix soon though. Link to comment Share on other sites More sharing options...
PPSA Posted January 10, 2016 Share Posted January 10, 2016 (edited) The solution proposed by "zmacedoni" solved the same issue I was experiencing with "cancelling" an order in Prestashop 1.6.1.3!Thank you for the support! Edited January 12, 2016 by The Devils Parts (see edit history) Link to comment Share on other sites More sharing options...
my-software Posted January 12, 2016 Share Posted January 12, 2016 Hi, Be careful, this bug is still occur in 1.6.1.3 version ! Thank you for resolve this problem ! Peter 1 Link to comment Share on other sites More sharing options...
my-software Posted January 20, 2016 Share Posted January 20, 2016 I saw the same code in 1.6.1.4 version. Best, Peter 1 Link to comment Share on other sites More sharing options...
EdEichman Posted January 22, 2016 Share Posted January 22, 2016 (edited) It is a bug in file Core/Business/Stock/Core_Business_Stock_StockManager.php at line 126 you should have like this: $stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity; $stockAvailable->id_product = (int)$product->id; $stockAvailable->id_product_attribute = (int)$id_product_attribute; $stockAvailable->update(); I'm using PrestaShop 1.6.1.4, NOT using multishop. The symptom that I was trying to treat was an error message when trying to place an order "Cart cannot be loaded or an order has already been placed using this cart". When debugging on my localhost, I got "[PrestaShopException] Property StockAvailable->id_product_attribute is empty - at line 909 in file classes/ObjectModel.php". My ps_stock_availability table (which several people indicated as the base problem) was fine. Applying the fix above solved the problem for me. Prior to the "Cart cannot be loaded or an order has already been placed using this cart", on the same customer, we first got a PayPal error "Error Occured" with a lot of into, but with PAYMENTREQUESTINFO_0_ERRORCODE = 0. We also had an order from the customer placed which had the correct total, tax etc., but which had no products in the basket. We then starting running into the problem when making a new order for the customer. These other problems may also be related... in any case, our EXCELLENT customer support was still able to land the sale (thanks, Susana!). THANKS, zmacedoni! NOTE: There is an open issue on this in Forge... I've added my upvote and my details: http://forge.prestashop.com/browse/PSCSX-6890 Edited January 22, 2016 by EdEichman (see edit history) 1 Link to comment Share on other sites More sharing options...
EdEichman Posted January 29, 2016 Share Posted January 29, 2016 Note that there are two versions of "Cart cannot be loaded or an order has already been placed using this cart". One of them is what appears to be a benign warning (coming from FrontController and marked as warning level 1 (informative only)) that a new cart is being generated after an order is placed. https://www.prestashop.com/forums/topic/466782-cart-cannot-be-loaded-or-an-order-has-already-been-placed-using-this-cart/page-3 suggests a fix for that one, but it appears to be more on an annoyance in the logs than a real problem. The other is a level 4 (major issue - crash!) generated by the PaymentModule. That is the one that I was having related to this bug. The fact that the text for both is the same is confusing, so I though I would mention it. 1 Link to comment Share on other sites More sharing options...
f31n Posted March 23, 2016 Share Posted March 23, 2016 I saw the same code in 1.6.1.4 version. Best, Peter still here in 1.6.1.4 is there a reason you call a version stable but its buggy as hell? Link to comment Share on other sites More sharing options...
ker Posted March 30, 2016 Share Posted March 30, 2016 Thank you, it's solved my troubles too ! Link to comment Share on other sites More sharing options...
jmeca Posted April 13, 2016 Share Posted April 13, 2016 Thans from me too, it solve problems ps 1.6.14 Link to comment Share on other sites More sharing options...
jmeca Posted April 15, 2016 Share Posted April 15, 2016 The bug still in 1.6.15 update Link to comment Share on other sites More sharing options...
keineus Posted May 23, 2016 Share Posted May 23, 2016 Hi all, it seems, that I got the issue...I use advance stock management...and it isn't possible to place orders via PayPal Payment, the order isn't set within prestashop. I tried to edit the file mentioned...but it doesn't work. Do I need the empty cache or someting else? I tried to switch from advance stock management to manual edit and I was able to place the order with paypal...so I think this is the problem...but how can I fix it. Thanks. Link to comment Share on other sites More sharing options...
keineus Posted May 24, 2016 Share Posted May 24, 2016 hmm..okay...thanks for your information! Link to comment Share on other sites More sharing options...
Jhorene Posted July 29, 2016 Share Posted July 29, 2016 Hello, I tried this fix and hoping that it worked - it works on my test order but the real test will be if someone else places orders now. Can you please tell me if it is possible to retrieve in the database the products that belonged to those blank orders to make up the totals of the orders? Thank you in advance. Regards, Jhorene Link to comment Share on other sites More sharing options...
don@ptg Posted July 29, 2016 Author Share Posted July 29, 2016 Hello, I tried this fix and hoping that it worked - it works on my test order but the real test will be if someone else places orders now. Can you please tell me if it is possible to retrieve in the database the products that belonged to those blank orders to make up the totals of the orders? Thank you in advance. Regards, Jhorene What we did on the blank orders, is look at the customers cart. The products were still there and it helped us recover the orders. Link to comment Share on other sites More sharing options...
brelano Posted September 3, 2017 Share Posted September 3, 2017 There is a thread here that already deals with this but I thought that maybe it had gone unnoticed since the newest version of PrestaShop still has the problem. https://www.prestashop.com/forums/topic/465898-error-al-crear-pedido-manual-solucionado/ The our web site was originally launched on 1.6.1.0. The 1.6.1.1 upgrade broke the payment proccess, and we had the same fault with the upgrade to 1.6.1.2 this morning. We have the USA Epay Module from Presto-Chango installed as our only payment module. When the classes/stock/StockAvailable.php is left as is some products would cause the payment window to hang and the page will never redirect. I turned on developer mode to get this error. Fatal error: Uncaught exception 'PrestaShopException' with message 'Property StockAvailable->id_product_attribute is empty' in /home/ptg/public_html/classes/ObjectModel.php:909 Stack trace: #0 /home/ptg/public_html/classes/ObjectModel.php(246): ObjectModelCore->validateFields() #1 /home/ptg/public_html/classes/ObjectModel.php(652): ObjectModelCore->getFields() #2 /home/ptg/public_html/classes/stock/StockAvailable.php(406): ObjectModelCore->update(false) #3 /home/ptg/public_html/Core/Business/Stock/Core_Business_Stock_StockManager.php(128): StockAvailableCore->update() #4 /home/ptg/public_html/classes/stock/StockAvailable.php(472): Core_Business_Stock_StockManager->updateQuantity(Object(Product), '0', -1, NULL) #5 /home/ptg/public_html/classes/order/OrderDetail.php(473): StockAvailableCore::updateQuantity('577', '0', -1) #6 /home/ptg/public_html/classes/order/OrderDetail.php(638): OrderDetailCore->checkProductStock(Array, '2') #7 /home/ptg/public_html/classes/order/OrderDetail.php(678): OrderDetailCore->create(Object(Order in/home/ptg/public_html/classes/ObjectModel.php on line 909 Replacing the classes/stock/StockAvalible.php file with the one from 1.6.1.0 seems to have solved the problem. For both of the newer versions. It does seem to be fixed, but if this is not the correct way to solve the problem, then I would appreciate the feedback. The other thread is difficult for me to follow since I do not read any other language. Google translate seems to help though. Worked!!! Thank you, it was making me mad! 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