Zen Cart Logo
Forums / All Other Contributions/Addons / Additional Customers Fields

Additional Customers Fields

Locked

Views: 88,139

Results 341 to 360 of 491
This thread is locked. New replies are disabled.
23 Jun 2007, 21:10
#341
beilana avatar

beilana

New Zenner

Join Date:
Apr 2006
Location:
Phoenix, AZ
Posts:
84
Plugin Contributions:
0

Additional Customers Fields

Yes - that is the only information I have ...

"// Donation
If you like this MOD, please send a donation to: **[email protected] **(paypal). It would be greatly appreciated (especially for all the time you waited for this moment to happend)."

I sent it to this email.

Should I just try it again?

23 Jun 2007, 21:57
#342
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Please do not post emails on the forum. It will encourage spammers to use it.

As for your last report, it states: [email protected] and NOT my other one from above. I think you did not used the right server name. :wink2:

You can always retry with the one you just posted. Should work.

23 Jun 2007, 23:08
#343
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Update:

A new version has been uploaded on my site. It contains some bug fixes from the last version. For those who needs to upgrade, simply follow the upgrade and changelog documentation as usual.

24 Jun 2007, 22:34
#344
blitz49 avatar

blitz49

New Zenner

Join Date:
Apr 2005
Posts:
99
Plugin Contributions:
0

Re: Additional Customers Fields

Theoracle,

Sorry, but I think I spoke too soon about it working with MYSQL 5. Today when I tested to add a new customer, I get this error when creating an account.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customers_id = '22'' at line 3
in:
[update customers set customers_default_address_id = '22', where customers_id = '22']

Even with that error, the account is created and displayed in customers, but when you go in to edit, the account information is empty. I can't even delete the account. I get the following warning message when trying to edit or delete the new created account. Accounts that were inputted before the installation of the MOD seem to able to edit and delete fine.

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/xptrading/www/www/admin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in /home/xptrading/www/www/admin/includes/classes/object_info.php on line 30
24 Jun 2007, 22:38
#345
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

No, actually, it must be coming from your create_account.php file.

What does it report on your customers_id 22 on your phpmyadmin for the customers_default_address_id field ?

24 Jun 2007, 22:49
#346
blitz49 avatar

blitz49

New Zenner

Join Date:
Apr 2005
Posts:
99
Plugin Contributions:
0

Re: Additional Customers Fields

TheOracle:

No, actually, it must be coming from your create_account.php file.

What does it report on your customers_id 22 on your phpmyadmin for the customers_default_address_id field ?

There is a 0 in there. But when I input the number 22 myself the account works with no errors

24 Jun 2007, 23:42
#347
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

What is the array you have on where the moderators_level is being called from your create_account.php file (post the whole array block) ?

25 Jun 2007, 00:14
#348
blitz49 avatar

blitz49

New Zenner

Join Date:
Apr 2005
Posts:
99
Plugin Contributions:
0

Re: Additional Customers Fields

TheOracle:

What is the array you have on where the moderators_level is being called from your create_account.php file (post the whole array block) ?

I am using the updated create account that you just released. Here it is:

 if ($error == true) {
    // hook notifier class
    $zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
  } else {
    $sql_data_array = array('moderators_level' => 1,
                            'customers_firstname' => $firstname,
                            'customers_lastname' => $lastname,
                            'customers_email_address' => $email_address,
                            'customers_nick' => $nick,
                            'customers_telephone' => $telephone,
                            'customers_fax' => $fax,
                            'customers_newsletter' => (int)$newsletter,
                            'customers_email_format' => $email_format,
                            'customers_default_address_id' => 0,
                            'customers_password' => zen_encrypt_password($password),
                            'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
    );

    if ((CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '')) $sql_data_array['customers_referral'] = $customers_referral;
    if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
    if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = (empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']));

    zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);

    $_SESSION['customer_id'] = $db->Insert_ID();

    $sql_data_array = array('customers_id' => $_SESSION['customer_id'],
                            'entry_firstname' => $firstname,
                            'entry_lastname' => $lastname,
                            'entry_street_address' => $street_address,
                            'entry_postcode' => $postcode,
                            'entry_city' => $city,
                            'entry_country_id' => $country);

    if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
    if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
    if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
    if (ACCOUNT_STATE == 'true') {
      if ($zone_id > 0) {
        $sql_data_array['entry_zone_id'] = $zone_id;
        $sql_data_array['entry_state'] = '';
      } else {
        $sql_data_array['entry_zone_id'] = '0';
        $sql_data_array['entry_state'] = $state;
      }
    }

    zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

    $address_id = $db->Insert_ID();

      // Additional customers fields.
      $additional_sql = "";    
      $table_fields = $db->get_table_fields(TABLE_CUSTOMERS);
      if (isset($table_fields) && !empty($table_fields)) {
          foreach ($table_fields as $key => $val) {
              if (!in_array($key, $customers_table_fields)) {
                  $key = zen_output_string_protected($key);
                  if (isset($_POST[$key]) && isset($table_fields[$key]) && eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", zen_db_prepare_input($_POST[$key])) && zen_validate_email($_POST[$key]) == true) {                              
                      $additional_sql .= "$key = '".zen_db_prepare_input($_POST[$key])."', ";
                  } elseif (isset($_POST[$key]) && isset($table_fields[$key]) && preg_match("/[a-zA-Z0-9\.\,;:%&#@!\^-_~`\"'\[\]\{\}\*\/\?\(\)\n\r]/", $_POST[$key])) {
                      $additional_sql .= "$key = '".zen_db_prepare_input(strip_tags($_POST[$key]))."', ";          
                  } // End of if statement.
              } // End of if statement.
          } // End of foreach statement.
      } // End of if statement.
      if (!empty($additional_sql)) {
      $additional_sql .= substr($additional_sql, 0, strlen($additional_sql) -2);
      }    

    $sql = "update (" . TABLE_CUSTOMERS . "
               set customers_default_address_id = '" . (int)$address_id . "', " . zen_db_output($additional_sql) . "
               where customers_id = '" . (int)$_SESSION['customer_id'] . "')";

    $db->Execute($sql);
    // End of additional customers fields.

    $sql = "insert into " . TABLE_CUSTOMERS_INFO . "
               (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
               values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";

    $db->Execute($sql);

Also I am having problems with customer viewing or changing information on the customer end.

1054 Unknown column 'ac.field_required' in 'field list'
in:
[SELECT c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, c.customers_telephone, c.customers_fax, c.customers_email_format, c.customers_referral, ac.field_name, ac.field_status, ac.field_required , c.customers_cellphone FROM (customers c, customers_additional ac) WHERE c.customers_id = 26]
25 Jun 2007, 00:27
#349
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

1054 Unknown column 'ac.field_required' in 'field list'
in:
[SELECT c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, c.customers_telephone, c.customers_fax, c.customers_email_format, c.customers_referral, ac.field_name, ac.field_status, ac.field_required , c.customers_cellphone FROM (customers c, customers_additional ac) WHERE c.customers_id = 26]

An excellent and embarrassing catch. I knew I was missing something. This is not good - this is not good at all. :blush:

I tried a little project but canceled it for now. I just forgot to remove that field when finished. One little file behind. :D

Sorry about that - package ready on my site. Simply delete your last created customers field you did (from your phpmyadmin of course) and try again once you have followed the upgrade and changelog documentation. :wink2:

25 Jun 2007, 00:42
#350
blitz49 avatar

blitz49

New Zenner

Join Date:
Apr 2005
Posts:
99
Plugin Contributions:
0

Re: Additional Customers Fields

TheOracle:

An excellent and embarrassing catch. I knew I was missing something. This is not good - this is not good at all. :blush:

I tried a little project but canceled it for now. I just forgot to remove that field when finished. One little file behind. :D

Sorry about that - package ready on my site. Simply delete your last created customers field you did (from your phpmyadmin of course) and try again once you have followed the upgrade and changelog documentation. :wink2:

Okay that fixed it.

But still having problems with the create_account.php.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customers_id = '22'' at line 3
in:
[update customers set customers_default_address_id = '22', where customers_id = '22']

25 Jun 2007, 00:47
#351
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

[update customers set customers_default_address_id = '22', where customers_id = '22']

Special fix for you it would seem (since I cannot reproduce this problem).

In your create_account.php file,

find:

if (isset($_POST[$key]) && isset($table_fields[$key]) && eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", zen_db_prepare_input($_POST[$key])) && zen_validate_email($_POST[$key]) == true) {                              
                      $additional_sql .= "$key = '".zen_db_prepare_input($_POST[$key])."', ";
                  } elseif (isset($_POST[$key]) && isset($table_fields[$key]) && preg_match("/[a-zA-Z0-9\.\,;:%&#@!\^-_~`\"'\[\]\{\}\*\/\?\(\)\n\r]/", $_POST[$key])) {
                      $additional_sql .= "$key = '".zen_db_prepare_input(strip_tags($_POST[$key]))."', ";          
                  } // End of if statement.

replace with:

if (isset($_POST[$key]) && isset($table_fields[$key]) && eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", zen_db_prepare_input($_POST[$key])) && zen_validate_email($_POST[$key]) == true) {                              
                      $additional_sql .= "$key = '".zen_db_prepare_input($_POST[$key])."'";
                  } elseif (isset($_POST[$key]) && isset($table_fields[$key]) && preg_match("/[a-zA-Z0-9\.\,;:%&#@!\^-_~`\"'\[\]\{\}\*\/\?\(\)\n\r]/", $_POST[$key])) {
                      $additional_sql .= "$key = '".zen_db_prepare_input(strip_tags($_POST[$key]))."'";          
                  } // End of if statement.

Then, retry the same instructions as above. It should work now (perhaps it's another fix for mySQL v5.x).

25 Jun 2007, 01:33
#352
blitz49 avatar

blitz49

New Zenner

Join Date:
Apr 2005
Posts:
99
Plugin Contributions:
0

Re: Additional Customers Fields

Its not working still, I am still getting the same error. Forgot to test to input data, when I input a cellphone number I get this error:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'customers_cellphone = '213-555-220 where customers_id = '32'' at line 2
in:
[update customers set customers_default_address_id = '32', customers_cellphone = '213-555-2200'customers_cellphone = '213-555-220 where customers_id = '32']

I think this code is the problem

    $sql = "update " . TABLE_CUSTOMERS . "
               set customers_default_address_id = '" . (int)$address_id . "', " . zen_db_output($additional_sql) . "
               where customers_id = '" . (int)$_SESSION['customer_id'] . "'";
25 Jun 2007, 01:38
#353
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

In order to resolve this problem, I'd need direct access to your FTP server and try this out. Otherwise, it would be quite difficult to fix this. If you wish, send me your server details by email and I will take a look at it.

25 Jun 2007, 01:52
#354
blitz49 avatar

blitz49

New Zenner

Join Date:
Apr 2005
Posts:
99
Plugin Contributions:
0

Re: Additional Customers Fields

TheOracle:

In order to resolve this problem, I'd need direct access to your FTP server and try this out. Otherwise, it would be quite difficult to fix this. If you wish, send me your server details by email and I will take a look at it.

Ok, email sent [email protected].

25 Jun 2007, 03:15
#355
beilana avatar

beilana

New Zenner

Join Date:
Apr 2006
Location:
Phoenix, AZ
Posts:
84
Plugin Contributions:
0

Re: Additional Customers Fields

Oracle,

I have noticed that this person may have drop-down date of birth installed.

If this is the case, part of the login gets redirected to Wishmagic for processing rather than <your_template>. You might want to duplicate your code there.

This may or may not be helpful.

Good Luck guys

25 Jun 2007, 04:35
#356
beilana avatar

beilana

New Zenner

Join Date:
Apr 2006
Location:
Phoenix, AZ
Posts:
84
Plugin Contributions:
0

Re: Additional Customers Fields

Never mind - I was wrong. I am having the same problem. Let us all know when you fix it.

Thanks,

25 Jun 2007, 15:20
#357
rbepple avatar

rbepple

New Zenner

Join Date:
Jun 2007
Posts:
71
Plugin Contributions:
0

Re: Additional Customers Fields

I have finally gotten back to check the status of this MOD and thanks for your hard work and efforts on fixing this MOD. I was wondering what the newest version of the MOD is because I only can find v2.1 that was updated on the 17th and it looks like you did a update on the 22nd or some where around there. Do I need a paypal account to make a donation to you through paypal?

25 Jun 2007, 15:42
#358
beilana avatar

beilana

New Zenner

Join Date:
Apr 2006
Location:
Phoenix, AZ
Posts:
84
Plugin Contributions:
0

Re: Additional Customers Fields

Just another user trying to help out -

Yes - they are fairly easy to set-up - I thought it was different at first, but you send it to his email address once you have set up your account.

25 Jun 2007, 16:45
#359
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Sorry for the delay in response. I seem to had difficulties with my internet connection (again) last night + this morning. It would seem to be back in normal now.

I have finally gotten back to check the status of this MOD and thanks for your hard work and efforts on fixing this MOD. I was wondering what the newest version of the MOD is because I only can find v2.1 that was updated on the 17th and it looks like you did a update on the 22nd or some where around there. Do I need a paypal account to make a donation to you through paypal?

Like I said; Package updated on my site. Do NOT trust the DEV team for the downloads section, they're too slow to update. Always check the upload date. Which is why, I have my own site for that (as I send updates to this topic to notify all users).

I have noticed that this person may have drop-down date of birth installed.

If this is the case, part of the login gets redirected to Wishmagic for processing rather than <your_template>. You might want to duplicate your code there.

Again, I do NOT do integration with other MODs unless it involves one of the override files from my package.

Do I need a paypal account to make a donation to you through paypal?

Not that I know of. You can donate directly by using your credit card I believe. If not, then - personally - I'd still suggest to create a paypal account in order to donate (for security reasons in the mean time).

I thought it was different at first, but you send it to his email address once you have set up your account.

Thanks for your input on this. :wink2:

25 Jun 2007, 20:06
#360
rbepple avatar

rbepple

New Zenner

Join Date:
Jun 2007
Posts:
71
Plugin Contributions:
0

Re: Additional Customers Fields

Great job everthing works swell on both admin side and customers side, with one little error. I get this error on the customer registration:

Fatal error: Call to undefined function get_support_ticket_tables() in /www/freehostingnow.com/c/o/m/commtech/htdocs/catalog/includes/modules/silverfish/create_account.php on line 324

Any help?