Jump to content

Auto-emptying cart and "birthday is invalid" bugs fixed!!! Advice / steps on how I resolved this problem


Recommended Posts

I've had a very unusual bug that I have only just managed to fix after many months.

I thought I would share this in case anyone else comes across something similar in the future.

Anyway for a while now, my shopping cart would automatically empty itself for a lot of existing customers (when trying to checkout).

Secondly, some customers also received a "birthday is invalid" message, even if A) the birthday field was not filled out, B) it was filled out correctly, or C) even if the whole field was disabled!

Because both problems occurred in the shopping cart I always assumed it was the same bug causing this, but after examining the 'ps_customer' table, it turns out it was two separate problems.

Firstly I found a common pattern between users that experienced this auto-emptying cart issue and users that did not. Users that got this issue had "0" in the deleted column! The Back Office doesn't allow you to delete customers, so I suspect this has to do with me adding

$this->delete = true;

to the AdminOrders.php page, so that I could delete test orders.

Secondly, users with the "birthday is invalid" error had a birthday of "0000-00-00", while everyone else had "NULL". How did some customer records get into this state? My theory is that "0000-00-00" is added by default if no birthday is entered. HOWEVER, the OnePageCheckout module (which I installed a few months after I started), inserts "NULL" in the same situation. My theory is that the OnePageCheckout module looks for "NULL" but finds "0000-00-00" which causes it to display the error incorrectly.


Anyway both these scenarios - deleting test orders (which I got from a popular thread on this forum) and the OnePageCheckout mods - are very popular so I'm surprised no one else has come across these issues? I have since fixed the data and run many tests which seem to confirm my theories, but I would be curious to see if anyone more technically minded than myself might be able to confirm if I am correct.

Cheers

Link to comment
Share on other sites

My theory is that "0000-00-00" is added by default if no birthday is entered.


Hi,

As for this problem, AFAIK the NULL value should be inserted to DB anytime there is no birthday selected, no matter if one page checkout module is installed or not.

Database related operation on customer table are encapsulated in Customer class and modules are normally just using Presta's API (or better said - core classes methods) to work with customer data.
Link to comment
Share on other sites

  • 5 months later...

Ok can you run another test using a ***brand new*** customer, and make sure his email address is definitely new (not in your ps_customer) database.

I'll help you isolate the problem. I suspect it is existing bad data that is causing this.

Link to comment
Share on other sites

can you post or PM me a link to your site or test site? I'll take a look. Unfortunately if it's not exactly the same problem I encountered I'm not sure if I will be able to help you much as I'm not a very technical person! It took weeks of investigation to find my issue

Link to comment
Share on other sites

Thank you for trying. It seems to be working now. I uninstalled OnePagecheckout and re-uploaded all involved files. I do however still have a problem. It is a "left-over" from OPC I think.

I think you can see it here:
http://www.jeepster.dk/authentication.php?back=order.php?step=1

Why is there a "hurtig ekspedition" box? It seems as though there is no use for it

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...