Jump to content

company_name in addressbook


keat

Recommended Posts

Weeks ago when I embarked on a V6 upgrade, I found that the addressbook table had no entries for company_name.

I assumed, this was because the same field in my V3 cart was called 'company'

Today, I did a dummy run of upgrading the live site, just for timings etc. However, before I did, i renamed this field 'company_name', hoping that after the upgrade to V6, this field in 'addressbook' would be populated.

However, it's still empty.

Am i correct in assuming that it should be populated, it is so in the 'customer' table, but not in the 'addressbook'

Alternatively could anyone suggest an SQL script which goes along the lines, copy company_name from customer_table to addressbook_table where customer_id = customer_id

Link to comment
Share on other sites

In looking at the install script for CC3.021, I do not find a database column called 'company' in the CubeCart_customer table or anywhere else. Perhaps your 'company' is a mod?

UPDATE `CubeCart_addressbook` AS A 
INNER JOIN `CubeCart_customer` AS C
ON A.`customer_id` = C.`customer_id` 
SET A.`company_name` = C.`company_name` 
WHERE C.`company_name` != '';

Be sure to use the appropriate column name C.`company_name` in line 4.

By JOINing the tables, there should be a resultant (temporary) record for each case where a customer could have one or more entries in the addressbook.

Link to comment
Share on other sites

company was indeed a mod.

However, I picked up on this a few weeks ago, so when i did my dummy run today, I renamed the field company_name, prior to running the upgrade script.

 

The sql script appears to have worked, I guess I ought to compare the data.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...