Page 1 of 1

1.5.6 How does table address work? 0 in customer_id

Posted: Fri Apr 04, 2014 3:46 pm
by sirsubliminal

So when installing a few different one page checkout extensions I noticed that all visitors could choose "Use a previous adress" on the checkoutpage not logged in.

The adresses and names that where displayed for all visitors came from the table address and had both customer_id set to 0 and zone_id set to 0. Like 20 or so looked like this out of hundreds of rows.

When editing the customer_id to anything but 0 the name, adress was not shown to all visitors on the checkout page.

I do not know why they where set to 0, anyone have a clue please let me know.

Is there a good wiki or something explaining the customer, addresses etc database schema and how they are connected, how it works?

Im not that keen on having thoose one page checkouts active if there is a chance more visitors/customers will be added in the address table with customer_id 0 and then their adresses shown to everyone on the checkout page. But I would really like to understand this since so I can try to fix it.

Re: 1.5.6 How does table address work? 0 in customer_id

Posted: Fri Apr 04, 2014 7:41 pm
by sirsubliminal
The main question I have is how/why does opencart set 0 for customer_id in the table address and what is that table meant to do? The invoice and deliveryadress are stored in the order and/or customer table (if a account is created).

I see no connection between table address and order. See

So the problem, and I guess alot of opencart users have, is that sometimes addresses are stored in table address with customer_id 0 and that might a real showstopper if your visitors all of the sudden can see your others customers names and addresses.