Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error Editing Customer Profile


Priest

Recommended Posts

Posted

When I go to edit a customer's profile, I get this error on the top of the page:

Warning: reset(): Passed variable is not an array or object in /home/demeter/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/demeter/public_html/admin/includes/classes/object_info.php on line 18

And it does not display any customer information in the fields.

 

Does anybody have any idea what may have happened? And how I can fix it.

 

~Priest~

Posted

Ok, I did figure out something. All of the accounts created PRE MS2.2 upgrade has this in the tables:

customers_default_address_id = 1

And do NOT cause a problem when viewing their accounts. However, the new accounts created have:

customers_default_address_id = 0

And DOES cause a problem. If I change the 0 to a 1 then everything works fine.

 

So the big question is: what do I change to get the customers_default_address_id to set as 1 and not 0.

 

Thanks,

Priest

Posted
Warning: reset(): Passed variable is not an array or object in /home/demeter/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/demeter/public_html/admin/includes/classes/object_info.php on line 18

 

I'm having the exact same problem, after upgradeing to 2.2.2 my old customers show up OK but the new ones get the above error.

 

Anybody got a fix, please. I'll carry on looking and post it up if I find it first :blink:

Posted

Anyone know of a fix for this? It is causing errors when orders are placed. I receive the invoice but noen of the customer information (name, address, telephone) shows up on the invoice.

 

HELP!

 

~Priest~

Posted

Great someone else with my problem....I also to updated to 2.2 from a 2.1 site and anyone adding their details gets added to the database had a look using mysql/myphpadmin and have noticed there are differences in the way the address book is set up, (default address id etc) tryed to make them the same as others that work fine but still no good. I have several other shops running for other clients with no problems,

 

Any other ideas

Posted

I know how you feel. I've been checkign my database several times a day just to change the "0" to a "1" for new customers, but if someone creates an account and immediately places an order, I get the order WITHOUT any customer details.

 

I HAVE to get this corrected. Please, if anyone has any ideas - share. This is really a big problem.

 

~Priest~

Posted

I know how you feel. I've been checkign my database several times a day just to change the "0" to a "1" for new customers, but if someone creates an account and immediately places an order, I get the order WITHOUT any customer details.

 

I HAVE to get this corrected. Please, if anyone has any ideas - share. This is really a big problem.

 

~Priest~

Posted

i have seen it in create_account_process.php but i am sure it is in other places also.i think i read somewhere that it is set at two diffrent#in ms1 and ms2

set to something other than zero i think

Posted

Ok, I have come up with what I'll call a Temporary Fix as it seems to be working for me but may have negative effects I have not found yet.

 

I am using MS2.2

 

BACKUP, BACKUP, BACKUP and try it at your own risk.

 

In create_account.php

Around Line 218

      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

 

Change to:

      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '1' where customers_id = '" . (int)$customer_id . "'");

 

It has worked for me and causes all new customers to be created with 1 set as the customers_default_address_id.

 

Again, BACKUP FIRST... and let me know of any problems anyone else encounters. Or, if you have a better way to correct the problem, please let me know.

 

~Priest~

Posted

IMPORTANT!

 

Well, the above code does set the customers_default_address_id to 1 and solves the problem of allowing the profile to be editable in the admin area, however during checkout, it still does not grab the customers information such as shipping/billing address, etc.

 

I do not know much about PHP so maybe this could be a start or something for someone who DOES know php and can help solve this problem.

 

Maybe the above code is invalid completely. All I know is that this problem is causing every order I receive to be erronous and needs to be corrected ASAP.

 

Thanks,

Priest

Posted

No, the database won't let it be changed to auto-increment, besides it needs to be set at 1 for each customer.

 

The default is set to 1 but whatever the code is in OSC seems to be overriding what is written to the database.

 

~P~

Posted

Oh, no, that's not the field I meant.

 

You have to change address_book.address_book_id (I think that's the one) to auto_increment. I had the same problem a while back.

Posted

OK I think I found the easy fix for this. Go to your address book in the db and then address_book_id and change the default to '0'! I tested it and it comes up with the addresses for orders and everything seems to work fine.

 

Or has everyone worked it out already because the thread was heading that way, cheers guys ;)

 

PLMK

Posted

I found that this works too, but the only problem I have located so far is that when the customer goes to "My Account" and then "View or change entries in my address book." it does not assign any existing address as the Primary Address since the address_book_id = 0

 

To get his to work, I have to manually go into the database and change new customers address_book_id to "1" and then their man address shows up as the Primary Address.

 

Other than that... it does seem to work for now.

 

Thanks,

Priest

Posted

I don't know if this helps everyone but I have over come the same problem this week. History - I did a new install using a new database then moved my data from the old database to the new one. This is when the problem started, now how I resolved it;

 

It seems the customers table has an index for the customer default address. This, in my customer table was always "1" and if I checked the addressbook table the customer_id was always "1" also. By changing both these to the proper customer_id for each registered customer it solved the problem.

 

My problem was worse as I had moved the data in customer table but all the other tables relating to customer data where not moved. This meant when I added new data relating to customers like registering these took ids which where already assigned to existing customers. So if you move customer data move all relating table first then move the customer table.

 

It would be really handy if someone who knew what they where doing could come up with an export import procedure.

-----------------------------------------------------------------------------

OSC user for years and no coder, so I've earned my stripes.

 

Feel free to private message me.

Posted
I know how you feel. I've been checkign my database several times a day just to change the "0" to a "1" for new customers, but if someone creates an account and immediately places an order, I get the order WITHOUT any customer details.

 

I HAVE to get this corrected. Please, if anyone has any ideas - share. This is really a big problem.

 

~Priest~

you can use phpmyadmin to set the database field to default to 1 (if this is your temporary fix) - not sure of the problem but am looking into it.....

 

Matti

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...