WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Assigning order id at the last possible moment.
  • Print
Pages: [1]   Go Down

Author Topic: Assigning order id at the last possible moment.  (Read 5884 times)

Offline bart538

  • Posts: 2
Assigning order id at the last possible moment.
« on: December 21, 2010, 04:00:51 PM »
I'm having the following problem:
When people are adding products to their cart, they get an order number.
But when they don't finish their order, this number has been used.
In my list of completed orders I'm getting order numbers from 1,2,5,10,23 etc
So I'm getting a lot of skipped order numbers. Ideally I would like to have a list of completed orders from 1,2,3,4 etc. for my administration.

I would like to get some suggestions on how to fix this.
I'm thinking about assigned the order id at the last possible moment, but don't know if this is the correct solution.
« Last Edit: December 21, 2010, 04:04:11 PM by bart538 »
Logged

Offline bart538

  • Posts: 2
Re: Assigning order id at the last possible moment.
« Reply #1 on: December 29, 2010, 07:16:19 PM »
*bump*
Logged

Offline mjm4842

  • Posts: 198
Re: Assigning order id at the last possible moment.
« Reply #2 on: January 08, 2011, 08:28:24 PM »
There isn't much that can be done about the order numbers not being sequential. However you could modify the code in such a way that invoice numbers would only be generated upon payment. It would be possible to ensure that these are sequential. I think this would address your concerns as long as all orders are paid for.

Michael
Logged
Frustrated? Spending too much time developing when all you really want is a working website? Contact me directly if I can be of services to you.
___________________ ________


www.tngconsulting.c a

Offline PurpleEdge

  • Posts: 231
  • Gender: Male
    • the northern beaches
Re: Assigning order id at the last possible moment.
« Reply #3 on: January 09, 2011, 01:05:47 AM »
This is a universal problem with all ordering systems that use the database autoinc value as the order number.

Two alternatives often used...

1. Use another field value as the order number, and populate that from a pool of available numbers, or only populate it when the order is confirmed. (Need to allow for deleted and cancelled orders, not just incomplete orders)

2. Save the order in a temporary storage - not in the database, and when the order is confirmed transfer the order to the database, creating the autoinc value at that time. In the web world cookies are often used as the temporary storage area - not sure how Bakery does it?

Neither is particularly easy to code, so the common approach is to live with gaps in the order numbering, or flag incomplete and deleted/cancelled orders appropriately and leave them in the database, so you won't get gaps in the order numbering, but you will have a lot of "dead" orders.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Assigning order id at the last possible moment.
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2