1

I am a relative novice at Magento (and new to StackExchange, so bear with me). My client is running a rather old community version (1.4).

They have set up checkout with Onepage checkout = YES, and Guest checkout allowed = NO.

What they discovered is that when new customers register as part of checkout, the customer record is not getting created. This seems like a pretty glaring error but in all my searching I can’t find anything to suggest that anyone is having this problem.

All of my research pointed to the submitOrder method of Quote.php as the place to look and I found this code:

if ($quote->getCustomerId()) {
            $transaction->addObject($quote->getCustomer());
        }

When I set a breakpoint at this point I (as I expected) found that this new customer has NO id, so the Customer object never gets added to the transaction.

Really, this seemed too obvious a problem so I kept exploring expecting to find that the Customer gets saved elsewhere, but found nothing. So, as a test, I changed the code to be:

 if (!$quote->getCustomerId()) {
            $transaction->addObject($quote->getCustomer());
      }

Well, the Customer and the Order got saved just as I hoped. But this seems WAY too obvious and might create issues for me if I want to save changes to customer data for existing Customers. But, I can deal with that for now.

I looked ahead in V1.8 to see if somehow this problem got fixed in a newer version, but the code is the same. That, and the fact that I can’t find any report of this problem makes me think I am not looking in the right place and have just put a convenient patch on the problem.

Can anyone help me out with this? Am I in the right place or way off base? Please advise!

Thanks in advance.

  • it seems that the code you are quoting is only meant to save the id of an existing customer (not a new one) to the transaction – pzirkind Mar 19 '14 at 20:51
  • Welcome to magento.stackexchange! Great you are here. Unfortunately your problem can't be reproduced with so less code and information. What version do you run? Do you have more extensions installed? Please have a look in the great debugging tutorial and report back. I didn't hear anything about such a bug, but 1.4 is 3 years ago... Beside of this problem, you should update your shop, at this moment we can shop for free. – Fabian Blechschmidt Mar 20 '14 at 00:23
  • Client is running Community Edition 1.4, no extensions. I wish I could upgrade them but the company who did the original install and customization did the unthinkable -- lots of custom code and they modified the core code without at least making a note of where they did it. We are looking at what it will cost to upgrade, but the client is cautious and does not have alot of money to spend. Yes, it does seem that the code I mentioned is designed to save an EXISTING customer. The question I have is thus, where is the code to save a NEW customer? I have not been able to find it. – user3438713 Mar 20 '14 at 02:54
  • Yikes 0.o that doesn't sound good. I'd start with downloading an original 1.4 edition and compare the core code. You can play around with the diffcommand to get a quick impression of all the changes that were made. Maybe something pops up that explains this. You can also turn off all third party modules by setting active = false in the module xml and go from there. Good luck. – Vicky Mar 20 '14 at 15:35
  • @user3438713 ever found out what was going on here? – David Manners May 23 '14 at 14:08

0 Answers0