Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

a problem, help is appreciated


Therick

Recommended Posts

Posted

Hello, im a rookie when it comes to PHP and mysql..

 

This is what I've done, I installed the shop and set it up

as I wanted it to look, using catalog/admin and I've been

changing some stuff in the php files as well using notepad.

 

Now when registrering account, this is what I get:

 

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

 

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

 

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

 

 

I'm thinking about reinstalling oscommerce, but I want to do a backup first. How do I do? I thought that I should copy the whole /catalog

at first

 

but thats not enough, right? How do I backup the mysql files and databases and that stuff??

 

Do you got any good idea how to fix this problem as easy as possbile??

 

Kind regards, have a good day :)

 

/ therick

  • 3 weeks later...
Posted

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 ! :) :)

Archived

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

×
×
  • Create New...