Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Duplicate Orders

I have a Magento site using version 1.6.2.0 with which I'm experiencing problems with duplicate orders.

Having researched the subject I have found mostly forum threads explaining that 1.4.x had problems with duplicate orders and the solutions mentioned (even those on SO which I have found) merely suggest the user updates Magento to >1.4.

I have also found a proposed solution here but am reluctant to delete observers which will prevent downloadable purchases working.

I've also spotted the Array Of Death fix mentioned a few times (e.g. here) but this problem isn't present in 1.6.x, Zend appears to have resolved it.

There are a couple of Javascript hacks suggested whereby the Confirm Order button is hidden upon submission but Magento 1.6.x already does this.

I have increased the payment gateway timeout configuration variable to 120 seconds and am as yet to see if it yields results. I can't test it as the problem is intermittent (and probably therefore caused by communication or lack thereof between the payment gateway and Magento).

I am using Sagepay as the payment gateway.

How might I further debug this?

like image 645
Ben Swinburne Avatar asked Jun 19 '12 13:06

Ben Swinburne


1 Answers

The link you posted is correct, but I wouldn't use their fix, I would just disable the Mage_Rss module.

Mage_Rss has several observers in it that call Mage::app()->cleanCache(...) in the checkout process, which is extremely expensive if your installation is using the default filesystem cache and it's gotten large.

I found the best thing for troubleshooting Magento performance problems is to wire up Xhgui and do some profiling. Reading call stacks will help your understanding of Magento immensely also.

Oh, and I don't know if this is true for Sagepay, but I went and fixed this problem completely for PayflowPro by rewriting the method that generates transaction IDs to use the quoteID instead of generating unique IDs on every invocation. I started down the path of committing this back, but I'm on 1.4.2 still and don't have time to test in later versions and it's a pretty significant rewrite. Guess I could just put it out there for someone else to run pass Moses...

like image 127
gazarsgo Avatar answered Oct 18 '22 19:10

gazarsgo