There is really no difference between having a setup like this and one where the user's register first except how you associate the order with the user. Typically you would just insert the userID into the orders table to make the association. You can still do it this way, you will just need to do a check in the user's table to ensure that you do not have that user recorded already. If you do then no problem, just record the user's ID and bind that with the order.
If the user does not already exist though you can just insert them yourselves, then store the id in a session variable and insert that in the orders table to associate the user.
If you are looking to be able to have the user come back to the site later to see their history you will have to come up with a way to allow the user's access. One way to do this is to create a password for the user when you insert them into your user's table and send an email letting the user know their password.