Forums / All Other Contributions/Addons / Extra Fields for Customer Sign Up (Create Account) Page

Extra Fields for Customer Sign Up (Create Account) Page

Views: 264,940

Results 181 to 198 of 198
15 May 2024, 1:48 PM
#181
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Extra Fields for Customer Sign Up (Create Account) Page

I was curious so I downloaded and attempted to install. The plugin is a bit of a mess.

One reason it is failing is this -

/var/www/html/zencart200/includes/languages/english/extra_definitions/extrafield_defines.php

Line #41 : if (EXTRAFIELD_REQUIRED == 'true') {

Line #47 : if (EXTRAFIELD_REQUIRED2 == 'true') {

Line #56 : if (EXTRAFIELD_REQUIRED3 == 'true') {

Line #64 : if (EXTRAFIELD_REQUIRED4 == 'true') {

The EXTRAFIELD_REQUIRED constants aren't defined anywhere - I'm guessing they were supposed to be set in admin but this plugin doesn't include this?

Adjusting this code to just assume always true might quickly sort this out - ie remove the if statements.

I don't know how you went about merging the files but the create_account file under modules needs a bit of a tweak compared to older versions.

So, short answer to your question is "no", unless there is someone else out there who is using this and has kept quiet.

15 May 2024, 2:34 PM
#182
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

This was an out of the box ZC 2.0 install specifically to test on a fresh system.
I did not change anything just followed the instructions which over wrote the existing files.

15 May 2024, 3:33 PM
#183
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

Re: Extra Fields for Customer Sign Up (Create Account) Page

We are always looking for developers who would be willing to adopt orphaned plugins.

https://docs.zen-cart.com/dev/plugins/adoption/

It's a great way to help support the project.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

16 May 2024, 1:52 AM
#184
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Extra Fields for Customer Sign Up (Create Account) Page

linuxguy2:

This was an out of the box ZC 2.0 install specifically to test on a fresh system.
I did not change anything just followed the instructions which over wrote the existing files.

That definitely won't work in 2.0.

How have you used the plugin in the past - did you use all four extra fields - was there a way to control which of the four extra fields you wanted?

The docs don't appear to mention this.

16 May 2024, 6:12 AM
#185
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Extra Fields for Customer Sign Up (Create Account) Page

Forget my question, I can see what's supposed to be going on. Will take a proper look later.

16 May 2024, 1:20 PM
#186
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Extra Fields for Customer Sign Up (Create Account) Page

OK, I've updated the plugin and sent linuxguy2 a private link they can download from.

I look forward to hearing back about testing - I'll submit it after some feedback.

It's working for me anyway :)

17 May 2024, 2:23 AM
#187
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

Great Job!!
NO Issues so far.
Tested with a ZC 2.0 out-of-the-box install and then with my customized ZC 2.0 install.
I'd say it's ready for primetime.

Tested with all 4 and only 1 & 4 Extra Fields

THANK YOU!!!

19 May 2024, 11:22 PM
#188
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

linuxguy2:

Great Job!!
NO Issues so far.
Tested with a ZC 2.0 out-of-the-box install and then with my customized ZC 2.0 install.
I'd say it's ready for primetime.

Tested with all 4 and only 1 & 4 Extra Fields

THANK YOU!!!

However,
I tried to get the extra fields to be included in the "Office Only" section of the Admins email and no joy.
Every thing looks OK and after 6 hours of debug I can't find the problem!
I modified "functions_email.php" and "lang.email_extras.php" just as I did with the older versons but no joy.
When I enable the "extrafield" it chokes on "submit".
With just "Company" enabled it doesn't choke but Company does not display in the admin email.

         // LtoMod Add  company, extrafield, street address, city, state, zip, extrafield2 and extrafield4 
      $extra_info['HTML'] = 
	  '<table width="100%" class="extra-info">' .
      '<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
      '<tr><td  width="20%" class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
	  // '<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .	  
      ($login_email !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .	  
      ($login !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
	  ($company !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_COMPANY . '</td><td>' . $company . '</td></tr>' : '') .
	  ($extrafield !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD . '</td><td>' . $extrafield . '</td></tr>' : '') .
/*	  ($street_address !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS . '</td><td>' . $street_address . '</td></tr>' : '') .
	  ($suburb !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS_LINE2 . '</td><td>' . $suburb . '</td></tr>' : '') .
	  ($city !== '' ?'<tr><td class="extra-info-bold">' . OFFICE_CITY . '</td><td>' . $city . '</td></tr>' : '') .
	  ($state !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_STATE . '</td><td>' . $state . '</td></tr>' : '') .
	  ($postcode !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_POSTCODE . '</td><td>' . $postcode . '</td></tr>' : '') .	  
	  ($login_phone !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
      ($login_fax !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
	   ($extrafield2 !== '' ? '<tr><td  width="20%" class="extra-info-bold">' . OFFICE_EXTRAFIELD2 . '</td><td>' . $extrafield2 . '</td></tr>' : '') .	
	  ($extrafield4 !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD4 . '</td><td>' . $extrafield4 . '</td></tr>' : '') .
*/
	  '<tr><td class="extra-info-bold">' . " " . '</td><td>' . " " . '</td></tr>' .		
	  '<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .	  
      '<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
      '<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>';
	  
    foreach($moreinfo as $key => $val) {
      $extra_info['TEXT'] .= $key . ": \t" . $val . "\n";
      $extra_info['HTML'] .= '<tr><td class="extra-info-bold">' . $key . '</td><td>' . $val . '</td></tr>';
    }

	    foreach ($moreinfo as $key => $val) {
            $extra_info['TEXT'] .= zen_output_string_protected($key) . ": \t" . zen_output_string_protected($val) . "\n";
            $extra_info['HTML'] .= '<tr><td class="extra-info-bold">' . zen_output_string_protected($key) . '</td><td>' . zen_output_string_protected($val) . '</td></tr>';
        }

        $extra_info['TEXT'] .= "\n\n";
        $extra_info['HTML'] .= "</table>\n";

        return $extra_info;
    }
20 May 2024, 1:56 PM
#189
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Extra Fields for Customer Sign Up (Create Account) Page

linuxguy2:

However,
I tried to get the extra fields to be included in the "Office Only" section of the Admins email and no joy.
Every thing looks OK and after 6 hours of debug I can't find the problem!
I modified "functions_email.php" and "lang.email_extras.php" just as I did with the older versons but no joy.
When I enable the "extrafield" it chokes on "submit".
With just "Company" enabled it doesn't choke but Company does not display in the admin email.

Do you have any logs you can share with us?

20 May 2024, 4:22 PM
#190
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

royaldave:

Do you have any logs you can share with us?

Nothing in the logs. I think there may be a more basic issue here. Is it some setting in the configuration I'm missing?
I reviewed all the all the mods I did on the old version and especially create_account.php and functions_email.php and they look appropriate.
I'm going to do a fresh install without extrafields and see in the "Company' can be included in the "Office Only" Section

This is additional code I had in the old installation on the new install it creates the account but chokes before displaying the Welcome/Authorization screen.
Works on the old install.
```php
$extra_info = email_collect_extra_info($name, $email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);

// Worked on old installation $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $company, $extrafield, $extrafield2, $street_address, $suburb, $city, $state, $postcode, $extrafield4);


LOGS

    logmessage
Log reset by {xxxxser[1]}.
Accessed page [admin_activity.php]
Accessed page [index.php]
Accessed page [keepalive.php]
Accessed page [admin_activity.php]
Accessed page [admin_activity.php] with action=save. Review page_parameters and postdata for details.
Admin Activity Log accessed. Output format: CSV. Filter: all. (Download to browser)
Accessed page [index.php]
Accessed page [keepalive.php]
Accessed page [admin_activity.php]
Accessed page [admin_activity.php] with action=save. Review page_parameters and postdata for details.
Admin Activity Log accessed. Output format: CSV. Filter: all. (Download to browser)
20 May 2024, 6:23 PM
#191
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

Re: Extra Fields for Customer Sign Up (Create Account) Page

I'm guessing that in the old installation, you edited includes/functions/functions_email.php and changed function email_collect_extra_info() to account for these extra arguments.

Rather than do that, it would be better for you to populate the moreinfo array with this data.

add , $moreinfo as the last call to email_collect_extra_info in includes/modules/YOUR_TEMPLATE/create_account, i.e.

            $extra_info = email_collect_extra_info($name, $email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $moreinfo);

then right before this line:

$moreinfo = []; 
if (EXTRAFIELD_REQUIRED == 'true') { 
    $moreinfo[ENTRY_EXTRAFIELD] = $extrafield; 
}	
if (EXTRAFIELD_REQUIRED2 == 'true') {
    $moreinfo[ENTRY_EXTRAFIELD2] = $extrafield2; 
}	
if (EXTRAFIELD_REQUIRED3 == 'true') {
    $moreinfo[ENTRY_EXTRAFIELD3] = $extrafield3; 
}	
if (EXTRAFIELD_REQUIRED4 == 'true') { 
    $moreinfo[ENTRY_EXTRAFIELD4] = $extrafield4; 
}						

Note to @royaldave - we need a notifier here too so this can be done without changing this core file.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

21 May 2024, 2:35 AM
#192
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

swguy:

I'm guessing that in the old installation, you edited includes/functions/functions_email.php and changed function email_collect_extra_info() to account for these extra arguments.

Rather than do that, it would be better for you to populate the moreinfo array with this data.

add , $moreinfo as the last call to email_collect_extra_info in includes/modules/YOUR_TEMPLATE/create_account, i.e.

            $extra_info = email_collect_extra_info($name, $email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $moreinfo);

then right before this line:

$moreinfo = []; 
if (EXTRAFIELD_REQUIRED == 'true') { 
    $moreinfo[ENTRY_EXTRAFIELD] = $extrafield; 
}	
if (EXTRAFIELD_REQUIRED2 == 'true') {
    $moreinfo[ENTRY_EXTRAFIELD2] = $extrafield2; 
}	
if (EXTRAFIELD_REQUIRED3 == 'true') {
    $moreinfo[ENTRY_EXTRAFIELD3] = $extrafield3; 
}	
if (EXTRAFIELD_REQUIRED4 == 'true') { 
    $moreinfo[ENTRY_EXTRAFIELD4] = $extrafield4; 
}						

Note to @royaldave - we need a notifier here too so this can be done without changing this core file.

Well, you made that look easy... Thank You Both!!
Yes in the old installations I did modify the files you referenced.
I implemented the changes you recommended and it did pull the extrafields into the Office Only section of the Admin email.
So I should be good to go.
I plan to add the company name and address.

21 May 2024, 2:42 AM
#193
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

Thank You royaldave !!

26 May 2024, 4:02 AM
#194
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

linuxguy2:

Well, you made that look easy... Thank You Both!!
Yes in the old installations I did modify the files you referenced.
I implemented the changes you recommended and it did pull the extrafields into the Office Only section of the Admin email.
So I should be good to go.
I plan to add the company name and address.

One more time,
Need a way to include the Company Name, Address Line 2, City and Zip Code to the "Office Only" section of the Sign Up form email.
Because this is information is already collected on the sign up form why not have a way to add it to the email?

I am already using the other 4 "Extra Fields for Customer Sign Up (Create Account) Page" fields to collect other data.

Rather than Hacking the core code I'd appreciate some guidance.

Thanks

26 May 2024, 11:39 AM
#195
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

Re: Extra Fields for Customer Sign Up (Create Account) Page

I have suggested that RoyalDave look into using the Observer Notifier feature in Zen Cart to build this plugin without needing to modify core code at all. If and when he does that, you'll be able to tag on to his work.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

26 May 2024, 2:54 PM
#196
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

swguy:

I have suggested that RoyalDave look into using the Observer Notifier feature in Zen Cart to build this plugin without needing to modify core code at all. If and when he does that, you'll be able to tag on to his work.

Thanks!

29 May 2024, 2:40 AM
#197
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Extra Fields for Customer Sign Up (Create Account) Page

linuxguy2:

Thanks!

V2.4 is now available as mentioned.

29 May 2024, 3:03 AM
#198
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: Extra Fields for Customer Sign Up (Create Account) Page

royaldave:

V2.4 is now available as mentioned.

Thanks!
I'll check it out in the AM