So, I was presented with an issue the other day on one of the shops I've worked on previously. The issue was that the orders were not showing up in the admin section.
"Piece of cake", I said.
I've seen several variations of this issue. Typically, they have something to with the status of the order, since an order with an unknown, or null status will not be displayed in the admin orders section.
Nope, that's wasn't it. I took a quick look in the database, and the orders statuses were all fine. While I was in the database, however, I did notice that all of the order statuses were all the same. 2147483647.
That's odd, I thought, as I scratched my head. So, I quickly pulled up the page that generates the order_id, checkout_process.php. Sure enough, it had been altered, in this case by the HSBC payment module, to generate a random number instead of letting the auto-number field in the database generate the id.
"Ah-ha!", I thought.
Nope, that wasn't it either. Echoing out the random number generated, it seemed to be working just fine. The id was being generated as follows...
{//Generation of the order_id
$r1 = rand(1,9);
$t1 = date("zHis");
$insert_id = $t1.$r1;
}
Echoing out $insert_id I got a number such as ... 2751043348.
But when I looked in the database, the number in the database was 2147483647. I took another look at the database, and the auto-increment was turned off, and the column was still defined as a int.
My thought at this point was that somehow the HSBC module was updating the order_id after processing the order. So, I disabled the rest of the checkout, and STILL the number inserted was 2147483647.
After scratching my head some more, I finally mentioned the issue to Dreamscape, who helped me figure out what the problem was.
Before I post the answer, does anyone want to take a stab at what it was?
Monday, October 10, 2005
Subscribe to:
Posts (Atom)
