2

We have been having trouble with customers duplicating their orders. Finding the cause is a subject for a different question. We are using a module we bought that overrides default cart behavior a bit.

I noticed that the duplicated orders have the same quote id. I was thinking that in the custom saveOrderAction() method, I could detect if an order with that quote id already exists. I would assume there is no reason someone would buy the same cart twice. I don't want to cause false positives though.

Is there a valid reason that two orders in the sales_flat_order table would have the same value for the column quote_id?

5

From a clean Magento standpoint, no. Every order should only be related to one quote, and vice-versa.

I know there are some modules out there that will use a single quote for multiple orders to create a subscription functionality; however, they too should create a new quote from the original order's quote.

You could actually add a check after the customer logs in. Once a customer logs in (either during checkout or through the "My Account" link) the most recently created, non-completed quote is loaded into the session and merged with the "guest" quote. You could also add a check for a corresponding order in this place and generate a new quote and use that instead.

Generally speaking if the quote is being used twice (and people aren't just double-clicking the "Checkout" button), I would suspect it's in the loading of the next incomplete quote (one that has no corresponding order) during customer session initialization more than during checkout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.