@Chris Farley Thanks for posting your observation. From that I was able to trace the root of the problem (at least mine). I found that the problem was actually fixed in version 1.3.2.2 (from the release notes: “Fixed #13706: Edit Order SQL Error").
Now, if you don’t want to upgrade to the latest release, my early test show you can just replace one file to fix the problem. Download 1.3.2.2 and replace /app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php. There are three blocks of code that it replaces related to the customer.
Again, I just tried this fix today so be a little cautious, but I do think it fixed the problem. I wound be interested to hear if it worked for you or if you ran into any issues. Thanks again.
Is this still a core bug or some broken data in database? exactly this problem occurs in version 1.4.1.0.
Tried to upgrade to 1.4.1.1 but this did not help.
Thank you, mike222. I received the same error when trying to reorder from the customer dashboard. I think this problem occured becasue I used a faulty sql query to clean up my db of logs and test orders. It is working now thanks to your code - I just hope I didn’t break anything else with the sql query that I jsut haven’t found yet..
OK, I just couldnt live with the fact that I had to modify the core to fix something that used to work flawlessly. So I looked through my entire DB (still guessing, I had fubared it with a cleanup script) only to find out, that everything here was fine.
After a long search I finally disabled my cart rules and voila I don’t need the fix anymore. This will most likely not help everybody in here, but it may be worth a try.
Now I just have to add these rules again without causing havoc in my shop again…
So to summarize: mike’s script works, but maybe there is no need for it, if you look and test thoroughly
The scariest thing about this issue is that apparently it can happen at a random time. It happened to me yesterday, when I went to see my client to officially finish my job and show him how to manage things, hehe. Great timing. Some other ppl report they got it like after 7 months, as I can see. “Very scary, oh no!”
I got the same issue so I look for a solution on this forum but despite a lots of solution posted on this forum, only Mike solution seems to works.
So I tried Mike solution but it did work for me maybe because I am not sure to understand properly what \” inserted the following code in the method _afterSave()\” mean.
In fact, because I can\’t find the terme \"method _afterSave()\” in my Quote.php file, I replace :
protected function _afterSave()
{
parent::_afterSave();
if (null !== $this->_addresses) {
$this->getAddressesCollection()->save();
}
if (null !== $this->_items) {
$this->getItemsCollection()->save();
}
if (null !== $this->_payments) {
$this->getPaymentsCollection()->save();
}
return $this;
}
TO :
protected function _afterSave()
{
parent::_afterSave();
if (null !== $this->_payments) {
// inserted code start
$this->getPaymentsCollection();
if ($this->getId()) {
foreach ($this->_payments as $payment) {
$payment->setQuote($this);
}
}
// inserted code end
$this->getPaymentsCollection()->save();
}
return $this;
}
Could you please tell me if I am doing the right modification ?
We get exactly the same error when the user adds a product to his shopping cart. The Shopping cart stays empty with the following error mesg “Cannot add the item to shopping cart.”
If we deactivate our shopping cart price rule everything works fine. We can add the product to the shopping cart. If we activate the shopping cart price rule again it still works. Once we delete all cookies from the browser the user can’t add products to the shopping cart anymore as long we don’t deactivate the price rule…
The shopping cart price rule is configured to work without a coupon code. If we change it to a price rule with a coupon code the error does not appear. The shopping cart price rule is configured to act only on certain sku’s if the client chooses a specific payment method.
Unfortunatly the fix in #5 does not work :-(
Any idea?
System => Configuration => WEB-Cookie Session => Cookie Lifetime: 86400
I reported that bug: http://www.magentocommerce.com/bug-tracking/issue?issue=10964