Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Registration error


Lucas.at

Recommended Posts

Hi!

 

If a customer wants to register at my store, the following error code appears:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/user/shop/catalog/includes/classes/email.php on line 71

 

Warning: Variable passed to each() is not an array or object in /var/www/user/shop/catalog/includes/classes/email.php on line 72

 

Fatal error: Call to a member function on a non-object in /var/www/user/shop/catalog/includes/functions/general.php on line 970

 

I can find him if i look up at customers in admin area.

 

Can u help me out there please.

 

I use OSC 2.2 MS2

shop can be found at: here

thx

lucas

Link to comment
Share on other sites

Hi.

I got the same problem on Unix platform but not on a Windows one.

I think this is really a (strange!) bug in oscommerce ms2.2

I found a workaround :

This only works if you don't care about "state" customer address information.

The idea is in eliminating the "state" customer address information anywhere in oscommerce.

 

In the file create_account.php, find :

 

    if (ACCOUNT_STATE == 'true') {
     $zone_id = 0;
     $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
     $check = tep_db_fetch_array($check_query);
     $entry_state_has_zones = ($check['total'] > 0);
     if ($entry_state_has_zones == true) {
       $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
       if (tep_db_num_rows($zone_query) == 1) {
         $zone = tep_db_fetch_array($zone_query);
         $zone_id = $zone['zone_id'];
       } else {
         $error = true;

         $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
       }
     } else {
       if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
         $error = true;

         $messageStack->add('create_account', ENTRY_STATE_ERROR);
       }
     }
   }

 

and replace with :

 

    if (ACCOUNT_STATE == 'true') {
     $zone_id = 0;
     $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
     $check = tep_db_fetch_array($check_query);
     $entry_state_has_zones = ($check['total'] > 0);
     /* if ($entry_state_has_zones == true) {
       $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
       if (tep_db_num_rows($zone_query) == 1) {
         $zone = tep_db_fetch_array($zone_query);
         $zone_id = $zone['zone_id'];
       } else {
         $error = true;

         $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
       }
     } else {
       if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
         $error = true;

         $messageStack->add('create_account', ENTRY_STATE_ERROR);
       }
     }*/
   }

 

In fact you have to comment a portion of code.

You have also to modifiy 8 other files to completely eliminate "state" address information.

 

In each of theses files :

 

address_book_process.php

checkout_payment_address.php

checkout_shipping_address.php

admin/customers.php

includes/form_check.js.php

includes/modules/address_book_details.php

includes/modules/checkout_new_address.php

 

Enclose each

if (ACCOUNT_STATE == 'true") {.....
....
...
}

 

with /* */

 

(or simply delete the blocks).

 

About half an hour work... and it works ! :) :)

Link to comment
Share on other sites

I edited all the files, sure that correct, but this error still apears.

 

There must be even an error in the whole mail-procedure.

cus i can send mails (rg. from admin-panel) but they never arrive.

 

Same with the reg-mail.

 

and customer deatils is set to false. should not matter then, or?

 

any other ideas?

Link to comment
Share on other sites

azimuth:

 

If it is a bug in PHP(version release), then is it a bug in php in handling the commands or in how it deals with syntax or in how it handles an error in the code itself? Is there perhaps a cleaner way to write this section to avoid stressing PHP or is that version of PHP breaking other code in other projects as well?

Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

×
×
  • Create New...