osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

customer primary address not set when new account created?

This is a discussion on customer primary address not set when new account created? within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; When a csutomer creates a new account, the address they enter during sign-up is not used at their Primary Address. ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 03-29-2006, 02:23 PM
chrismole's Avatar
Active Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 102
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 5
chrismole
Default customer primary address not set when new account created?

When a csutomer creates a new account, the address they enter during sign-up is not used at their Primary Address. So when they go to checkout the first time, there is no address listed in the Primary Address and won't let them checkout becasue shipping cannot be calculated. They can then go set their address as primary address, but this is not very intuitive.

Is this how it is supposed to work? If so, is there a way to set the user's address as Primary Address by default?

thx,
C
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 03-29-2006, 02:40 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,488
Thanks: 73
Thanked 334 Times in 313 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default RE: customer primary address not set when new account create

That is not how it works in a default install. When you create an account, the address IS set to the primary shipping address. If that is not how it is working on your shop, you have borked something for sure...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 03-29-2006, 08:22 PM
chrismole's Avatar
Active Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 102
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 5
chrismole
Default RE: customer primary address not set when new account create

That's what I was afraid of...

Any advice on what table(s) to start looking at and for what errors?

Thx,
C
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 03-29-2006, 09:13 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,488
Thanks: 73
Thanked 334 Times in 313 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default RE: customer primary address not set when new account create

Did you migrate the data from a different version of osC? I have see this behavior when the addressbook ID's do not match across the address_book table and the customer table. That is where I would look first.
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 03-30-2006, 06:55 AM
chrismole's Avatar
Active Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 102
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 5
chrismole
Default RE: customer primary address not set when new account create

Yes, I migrated from an older osC2.1 to the newer oscmax2. It's been a rough migration, but I am nearly done.

After looking at the database schema diagram, it looks like there are two corresponding fields in the tables you mention:
  • address_book: address_book_id
    customers: customers_default_address_id

When a new customer registers, they're address_book_id = 1, and customers_default_address_id = 0. This must be the problem, eh? I am guessing it should be customers_default_address_id = 1, not 0. If I login as customer and maually set my primary address, customers_default_address_id is set to 1.

Is this value set by code in catalog/create_account.php? Or where would you suggest I look for the code that is setting the value to 0 by default?

Thx,
C
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 03-31-2006, 01:08 PM
Member
 
Join Date: Feb 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
spottedhaggis
Default RE: customer primary address not set when new account create

How many clients do you have already in the system, if its not many it might be an idea to delete the tables, re-import them from the original script installation file, then create a new user with all entries filled, export it, compare it with your list of customers you exported before deleting the table and look for the mistakes. Then manually update the address book sql and re-import it.

least thats what I woudl do to it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 03-31-2006, 03:20 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,488
Thanks: 73
Thanked 334 Times in 313 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default RE: customer primary address not set when new account create

The problem stems from the old structure of the address_book table. In older versions, the primary key was different and indexes were different than the new structure. Because of this difference, the address book ID was 1 for all the addresses in the old table structure, but the number needs to be unique in the new strucutre.

Since the customers table also used the 1 value, they need to be matched with the new value in the address_book table. It is a pain in the rear, since each customer can have more than one address book ID, you need to eliminate the extra addressbook ids in the address_book table for each customer. Once you have a pared down list of addressbook_id's then you need to match that to the customer table, matching up the correct address book ids to the customer id's. Actually, once you remove the extra address entries per customer, they synch right up. Take a look at the tables as you read this, and it should start to make more sense to you (as reading it alone looks pretty much like gibberish).

It is a rather painstaking process, but it works. I have done it quite a few times and you will end up with a usable admin panel again. Good luck to you.
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #8  
Old 04-01-2006, 10:31 AM
chrismole's Avatar
Active Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 102
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 5
chrismole
Default RE: customer primary address not set when new account create

Hey, thanks for the input. I see what you're saying for sync'ing up existing customers and default addresses. Just to clarify, is it the two fields I mentioned above that need to match? I think so. Please confirm.
Code:
address_book.address_book_id = customers.customers_default_address_id
I have about 600 existing customers so I think I can get the ids sync'ed ok.

My bigger problem still remains. When NEW customers create a new account and enter an address during registration, it is by default set to 0 in the field "customers_default_address_id". How do I fix this to be 1? I thought it would be in the UPDATE statement in the file catalog/create_account.php. Is it? Or is it a database issue? Here's the statement on line 263:
Code:
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
However, I cannot locate a default value for the variable $address_id. In fact, I can't find the variable declared in any file in the catalog folder. Am I on the right track here?

Lastly, what did you mean in reference to the "usable admin panel"? As far as I can tell, there are no issues in the admin panel with customer addresses. Is that possible?

Thx,
C

P.S. I did just try creating a new customer account from the Admin panel and it did the same thing, set customers_default_address_id = 0.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #9  
Old 04-03-2006, 11:22 AM
chrismole's Avatar
Active Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 102
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 5
chrismole
Default RE: customer primary address not set when new account create

msasek,
when you say address_book_id needs to be unique, i guess you're saying it needs to match the customers_id... is that right? I have been focusing on values 1, 2, etc. for address_book_id and I guess that's the problem... ugh.

So, in the address_book table, I need to renumber all values for address_book_id for ALL customers to match customers_id? "Pain in the rear" does not begin to describe it. ;-\

For example, in the address_book table, customers_id = 543 needs to have address_book_id = 543? Please confirm before I go and do this. I tried renumbering one customer manually in the database and it did not seem to work...

Also, is it irrelevant what customers.customers_default_address_id is set to? As I mentioned, it seems to default to 0 and then change to 1 when I login as customer as manually set my primary address.

Call me dense, but I need more detailed instructions from you. Your time responding on this one is hugely appreciated...

C
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #10  
Old 04-04-2006, 01:18 PM
Member
 
Join Date: Feb 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
spottedhaggis
Default RE: customer primary address not set when new account create

What is a little weird is that I imported all the database info from a stock OSC shop with around 65 customers, and when I did tis I had no issue with the address display.

Having seen the standard OSC database address book table of yours Chris, it does not look the same as the osc one I had. My osc one had unique numbers for each address book entry, and where there was more than one address for a client the number would increment but the client id would always remain the same, as expected.

Your stock osc file had all 1's and 2's for each address book id, so importing this into oscmax would leave you with the exact same problem, as you now have.

Getting the address book id to increment is not a challenge, what will be is making sure that the numbers are correct for each customer.

Do you have an old backup database file in the old osc file, one that does not have as many clients in it, so I can look at this for you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
customer address required only ogilirca osCMax v2 Customization/Mods 4 01-02-2007 10:24 AM
Create Customer Account Address Questions joanstead osCMax v2 Features Discussion 0 02-16-2006 06:31 AM
After account is created - user is not taken to payment page Goweb osCMax v2 Installation issues 2 01-01-2006 09:58 AM
Email not sent after new customer account is created. Dumb_Question osCMax v2 Installation issues 7 12-16-2005 04:37 PM
primary address doesn't show gmartini42 osCMax v1.7 Discussion 2 02-06-2005 04:56 PM


All times are GMT -8. The time now is 08:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax