Nice find on the thousands separator! I would have missed that.
Please note that in stealman's he calculates the next order ID by incrementing the last order ID. In the code as far as I can see, this isn't used anywhere except stored in a DB. This is probably because he doesn't show another part of code which allows invoices to display transaction information.
Please note that incrementing the last order ID is, technically, not a correct way to find the current order ID. You see, the way Zen works, it only gives an Order ID to an order AFTER it has been processed (with payment). Before that, the customer could cancel their order. So the problem is that when you do a transaction, you have no simple way to associate it with an order until after the transaction has taken place (there are other functions in the payment modules that help do that).
The problem could occur that two customers are paying at the same time and simply incrementing the last order ID will give both of the transactions the same "next order id" value. This would become a very noticable problem if you have many orders per hour.
You can ignore this advice if you don't care about showing tx info in your invoices. The code will work fine.


Reply With Quote

