Zen Cart Logo
Forums / All Other Contributions/Addons / Add Customers from admin addon

Add Customers from admin addon

Views: 42,164

Results 101 to 120 of 263
01 May 2009, 21:53
#101
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Add Customers from admin addon

I can only guess that there is a specific server or installation issue with your site. This module has been installed on many many sites and emails go out without issue.

We just used it two weeks ago to import 8K customers from an old ASP cart and it worked fine and welcome emails were sent.

~Melanie

06 May 2009, 04:18
#102
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

I just looked at this module for someone who was experiencing problems with it not sending emails for bulk uploads. What I found was that if you have a 1 or zero in the csv file for send_welcome (as per the formatting guide), then there was no way any email could be sent. The module version being referred to here is 1.05

The statement at line 70 of add_customers_backend.php:php , 'send_welcome'=>(in_array(strtolower(get_row_id('send_welcome', $line)), array(false,'','n','no')) ? 0:1) is going to insert a value of 1 for $send_welcome even if you have a 0 in that field, because it's not even checking for a 0. So even if you had all lines set to 0 for send_welcome, you'd expect that every line would get an email sent as a result of that error. However, at line 415, the only condition under which the email will be sent is:```php
if($send_welcome == 'send')


To correct this problem, line 70 of add_customers_backend.php should be changed to:```php
, 'send_welcome'=>(in_array(strtolower(get_row_id('send_welcome', $line)), array(false,'','n','no','0')) ? 0:'send')

but wait - there's more...

at line 376, in the function insert_customer(), there is this code:```php
if (ACCOUNT_GENDER == 'true') {
if (!in_array(array('m','f'), substr(strtolower($entry_gender), 0, 1))) {
$errors[] = 'Gender not recognised. Expected "m" or "f", got: ' . $entry_gender;
}
$sql_data_array['entry_gender'] = $entry_gender;
}


Now, some people have been reporting in this thread that they are seeing php warnings from line 377 - this is why: there is no variable $entry_gender set. The variable that should be being checked is actually $customers_gender. 
This check has no place here in this function anyway - it should be part of the function validate_customer() - and what's the point of using ```php
substr(strtolower($customers_gender), 0, 1)
``` (using the correct variable) when $customers_gender has already been set to a single lowercase character string at lines 50 and 51?

One final point: 
I also found during troubleshooting this module that if there was only a single error in the csv file, and you have it set to process only if no errors, you get bounced right back to the start with no error message and no customers processed. In the file add_customers.php at line 66 is this condition for displaying errors:```php
if (count($errors) > 1) {

That's fine if you have more than one error, but if you have only one, then it won't get displayed. That line needs to be:

if (count($errors) > 0) {

A zip file with corrections for the above errors is attached to this post.

06 May 2009, 04:34
#103
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Add Customers from admin addon

Not ALL people are having issues with bulk email welcomes not being sent... only some.

For example I have 4 installations of this on my own sites and works perfectly, can even state in CSV some yes send and some no.

The gender issue is commented for those experiencing errors in the install.txt as follows.

No further reported bugs except some users will need to comment out
the gender related code in add_customers_backend.php (line 377)

This also is only a problem for some... matter of fact, months back we determined this was likely related to PHP as a CGI.

Ok, so my point is if you are going to rewrite the module... you need to think of all. Also, if you choose to rewrite it, you test it and release it properly including updating the version and bug fix log. This module has been Downloaded: 12861 times and another 500 or so from our store... with only these few issues reported here, most of which have been corrected for all users. Some will need PHP 5 as noted in the install log.

Add Customers page for Zen-Cart 1.3.5+
Modified from the Edit Customers page in the Zen-Cart Admin
by Aerodynamic_hippo 01/17/2007

Version 1.01 modified from Aerodynamic_hippo's 1.0 version by Rick Riehle on 2007-09-30. In v1.01 the new customer's password is automatically generated by the system using the zen_create_random_value function, rather than being generated and assigned by the admin. This is considered better security practice, because, at least in theory, no one but the customer knows the password. Note, however, that there is a hole in this logic: whoever receives a copy of the new account email notice will know the password. If you would rather be able to manually specify the password, use the 1.0 version. V1.01 is working in my test instance of Zen Cart v1.3.7; however, I recommend you test this before putting it into production, and include a review of the email that is sent to new customers. Many thanks to Aerodynamic_hippo for v1.0 of this useful mod. -- Rick Riehle 2007-09-30

  1. Upload all files to your store directory, the new menu item will be in the Customers menu.

This is the first modification I've made to Zen-Cart in module format, so please offer constructive criticism of my organization if it sucks :)

Please route questions through the Zen-Cart forums.


Version 1.03
Modified to allow bulk CSV uploading through the Zen Cart admin interface PRO-Webs.net 2008.

Version 1.04 2/18/2009
Minor bug fix changed partially absolute paths to full admin directory relative paths
as reported in support thread. Fixed open php reported and additional language file
line break. Uploaded fresh to a test store and created cuatomer w/o error,
email welcome and password were sent.

1 Bug remaining... #1 address is not imported to the proper field and company
name is not correctly imported.

If you fix this before we do, please contribute to the modules development
here http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=454

Version 1.05 2/28/2009
Bug fix provided via support thread davewest repairing the misplaced
customer fields on manual additions.

No further reported bugs except some users will need to comment out
the gender related code in add_customers_backend.php (line 377)

Some will need to select Select Part (Insert valid lines) when uploading bulk.

PHP 5 is required to use the Bulk Uploading Functions.


So, if 50 people grab it here and install it and have issues related to your fixes... I will get 50 emails :(

If you are going to repackage it... please follow the Zen Cart submission guidelines and repackage it correctly and submit it here http://www.zen-cart.com/index.php?main_page=index&cPath=40 :smile:

~Melanie

06 May 2009, 06:32
#104
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Add Customers from admin addon

bunyip,

I just loaded your corrected files and I'm cured! :hug:

Thanks for taking the time to work out the issues with this module.

I will test the changes on a different server, different host (also having problems with the original files) and let you know how that goes.

Tina

06 May 2009, 07:48
#105
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

I have updated the version and bugfix log with my changes, and submitted a complete package to the downloads section.

The updated version is now compatible with php4 and no longer requires php5 to use the bulk upload function. The error reported in earlier posts with regard to the function strripos was a result of trying to run it on php4, as that function was only introduced with php5. I've replaced that with the strrpos function, as it's only looking for the . before the file extension, and so a case-insensitive search isn't required.

The country IDs for US and UK are no longer hard-coded into the module - they are taken from the database.

The customer's password is now replaced with 'xxxxx' in the admin copy of the emails.

The store default setting for customer's email format is now used instead of a hard-coded 'HTML'.

The gender checking at line 377 that 'some users will need to comment out' according to the install.txt file has been fixed and should now function correctly for everyone.

I've tested the module on with Zen Cart 1.2.7/PHP 4.3/MySQL 4.0.24 and Zen Cart 1.3.8a/PHP 5.21/MySQL 5.0.27 without any problems.

06 May 2009, 11:09
#106
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Add Customers from admin addon

bunyip:

I have updated the version and bugfix log with my changes, and submitted a complete package to the downloads section.

The updated version is now compatible with php4 and no longer requires php5 to use the bulk upload function. The error reported in earlier posts with regard to the function strripos was a result of trying to run it on php4, as that function was only introduced with php5. I've replaced that with the strrpos function, as it's only looking for the . before the file extension, and so a case-insensitive search isn't required.

The country IDs for US and UK are no longer hard-coded into the module - they are taken from the database.

The customer's password is now replaced with 'xxxxx' in the admin copy of the emails.

The store default setting for customer's email format is now used instead of a hard-coded 'HTML'.

The gender checking at line 377 that 'some users will need to comment out' according to the install.txt file has been fixed and should now function correctly for everyone.

I've tested the module on with Zen Cart 1.2.7/PHP 4.3/MySQL 4.0.24 and Zen Cart 1.3.8a/PHP 5.21/MySQL 5.0.27 without any problems.

Excellent... now thats what open source is all about :clap:

07 May 2009, 14:53
#107
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

The updated package is now available from the downloads section

10 May 2009, 19:36
#108
danilyn22 avatar

danilyn22

Zen Follower

Join Date:
Dec 2008
Location:
California
Posts:
102
Plugin Contributions:
0

Re: Add Customers from admin addon

Hello

I downloaded and installed Add Customer from Admin today (may 10) so I assume I downloaded the latest version.

I am not wanting to bulk upload, I want to add customers one at a time.

Two things are happening

  1. No emails are being sent even though I am checking the box to send the Welcome Email. I have tried 4 different, real email addresses and they are not getting a welcome (nor is the junk mail folder)

  2. After adding a customer I get a Success message as well as a message that states

Invalid argument supplied for foreach() in /home/sondras/public_html/store/son627d/add_customers.php on line 71

I am on Zen 1.3.8

Any help would be appreciated

10 May 2009, 20:39
#109
danilyn22 avatar

danilyn22

Zen Follower

Join Date:
Dec 2008
Location:
California
Posts:
102
Plugin Contributions:
0

Re: Add Customers from admin addon

This is the followup to the above message.

I downloaded the previous version of the mod and loaded it to my storefront..

Now I am receiving the welcome emails but was getting the error on Line 377 of the :add_Customer_backend.php. I commented out lines 376 through 381

No errors and the welcome email!!

I am monitoring this thread so when you get the latest download fixed I would love to load it and use it but the problem does seem to be something in it.

Thanks

10 May 2009, 22:41
#110
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

danilyn,

in the file admin/add_customers.php (the latest version),
find this line of code at about line 406:

<input type="checkbox" id="send_welcome" value="send" name="send_welcome" />

and modify it to read:

<input type="checkbox" id="send_welcome" value="1" name="send_welcome" />
19 May 2009, 19:54
#111
epickz avatar

epickz

New Zenner

Join Date:
Dec 2007
Location:
San Diego
Posts:
2
Plugin Contributions:
0

Re: Add Customers from admin addon

I have installed everything and it works, with the exception of the csv upload. I get the following message "There were errors * Could not move file", any ideas. Please help :(

19 May 2009, 20:24
#112
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

epickz:

I have installed everything and it works, with the exception of the csv upload. I get the following message "There were errors * Could not move file", any ideas. Please help :(
It's possible that your server is configured to not allow or include the server variable $_SERVER['DOCUMENT_ROOT']

try replacing this line of code at line 26 of admin/add_customers_backend.php:

$path = $_SERVER['DOCUMENT_ROOT'] . '/' . $files['name'];

with this:

$path = DIR_FS_ADMIN . '/backups/' . $files['name'];
19 May 2009, 23:55
#113
epickz avatar

epickz

New Zenner

Join Date:
Dec 2007
Location:
San Diego
Posts:
2
Plugin Contributions:
0

Re: Add Customers from admin addon

Worked like a charm. Thanks a lot. Great add-on. :clap:

02 Jul 2009, 16:29
#114
andy_gs avatar

andy_gs

Zen Follower

Join Date:
Jun 2008
Posts:
187
Plugin Contributions:
0

Re: Add Customers from admin addon

Hey all,

Somone else asked this very question in this thread and didnt get an answer so i just want to the echo the question to get a response.

I want to set a default country when i use the add customer via admin.

Personally i want UK, but for others they may want wherever, so a generic response would be great.

regards

Andy.

02 Jul 2009, 16:46
#115
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

Edit admin/add_customers.php
Find this section of code:

zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id)

and change it to this:```php
zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), (zen_not_null($cInfo->entry_country_id) ? $cInfo->entry_country_id : 222))

where the '**222**' at the end is the country_id of your desired default country (222 = United Kingdom, 223 = United States)
02 Jul 2009, 16:55
#116
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Add Customers from admin addon

Alternatively, you could replace the 222 in the code suggested above to be SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY - that will set the default to whatever you have selected for the default account creation country at Admin > Configuration > Customer Details

02 Jul 2009, 17:48
#117
andy_gs avatar

andy_gs

Zen Follower

Join Date:
Jun 2008
Posts:
187
Plugin Contributions:
0

Re: Add Customers from admin addon

Thanks Buny,

i used:

zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), (zen_not_null($cInfo->entry_country_id) ? $cInfo->entry_country_id : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY ))

at first it didnt work but then i realised the code is on lines 793 and 798

thanks anyway for the quick reply :)

Andy.

12 Jul 2009, 21:07
#118
cattom avatar

cattom

New Zenner

Join Date:
Apr 2008
Location:
London
Posts:
27
Plugin Contributions:
0

Re: Add Customers from admin addon

Hello.

Is it possible to add nickname field to Add customer from admin.

Thank you.

01 Aug 2009, 08:30
#119
didee avatar

didee

Zen Follower

Join Date:
Jan 2009
Location:
Queensland, Australia
Posts:
115
Plugin Contributions:
0

Re: Add Customers from admin addon

bunyip:

danilyn,

in the file admin/add_customers.php (the latest version),
find this line of code at about line 406:

<input type="checkbox" id="send_welcome" value="send" name="send_welcome" /> ``` > and modify it to read: > ``` <input type="checkbox" id="send_welcome" value="1" name="send_welcome" /> ```

I have the exact same prolem as danilyn22. I followed your suggestion above, but then I couldnt get to my admin to log in. So had to reverse it. Not sure on what to do now, as I have read all thru the threads. I have the latest mod.

01 Aug 2009, 15:32
#120
eastern avatar

eastern

New Zenner

Join Date:
Jan 2009
Posts:
13
Plugin Contributions:
0

Re: Add Customers from admin addon

Hello,
I installed the mod, and am able to add the customer almost completely successfully. The new customer shows up in the customer list and I am able to send an email afterwards in the customer list. But, on adding the customer and selecting "send welcome email", no email is sent, and an error

"Warning: Invalid argument supplied for foreach() in /home/storename/public_html/store/admin/add_customers.php on line 71

(my italics added for obfuscation)

Any ideas?

With thanks
Eastern