Zen Cart Logo
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,834

Results 1 to 20 of 198
23 Jul 2010, 5:07 PM
#1
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Extra Fields for Customer Sign Up (Create Account) Page

OFFICIAL SUPPORT THREAD for the following contribution:
Extra Fields for Customer Sign Up
Zen Cart 1.3.9

Not yet in the downloads section, but has been submitted.

Enjoy!

7 Sep 2010, 2:24 PM
#3
eostre avatar

eostre

New Zenner

Join Date:
Apr 2005
Location:
Belgium
Posts:
47
Plugin Contributions:
0

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

I have downloaded your contribution, and it works fine for me! Tx!

I'm using this field for the tax number of my costumer.

I wonder how to add this additional field (code) on the invoice.php (Admin section) and packingslip.php, so it will appear on the order when i'm printing it!

Could you help me out with this one?

7 Sep 2010, 3:24 PM
#4
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

eOstrE, I haven't tried this yet, but in another thread a user posted this solution:

torvista:

Hi,
to display the taxid in the invoice either you can edit the ordering code so the taxid is included in the order information posted to the order table (would be better in future zen core) or you can get the taxid from customer table using the customer info from the order info as the reference.
I found the code for the second option by accident and I preferred it as it leaves the base code intact.

So, in admin/invoice.php add this query at line 28

$oID = zen_db_prepare_input($_GET['oID']);
//THESE LINES ADDED TO GET INFO FROM CUSTOMERS TABLE
$sql = "SELECT o.customers_id, c.customers_taxid from " . TABLE_ORDERS . " o, " . TABLE_CUSTOMERS . " c WHERE c.customers_id= o.customers_id and o.orders_id = '" . $oID . "'";
$chk_customers_taxid = $db->Execute($sql);
$customers_taxid = $chk_customers_taxid->fields['customers_taxid'];

so now you can use the $customers_taxid variable where you want, for example in one of the table cells

<?php echo ENTRY_TAXID_NUMBER; ?></b><?php echo ' ' . $customers_taxid; ?>

regards
Steve

Original thread: http://www.zen-cart.com/forum/showthread.php?t=73181

8 Sep 2010, 7:15 AM
#5
eostre avatar

eostre

New Zenner

Join Date:
Apr 2005
Location:
Belgium
Posts:
47
Plugin Contributions:
0

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

I have pasted the code in the document as shown, and i get this error message:

1054 Unknown column 'c.customers_taxid' in 'field list'
in:
[SELECT o.customers_id, c.customers_taxid from zenbooksorders o, zenbookscustomers c WHERE c.customers_id= o.customers_id and o.orders_id = '93806']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

This is rather Chinese to me...

8 Sep 2010, 4:45 PM
#6
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

Ahh... sorry that must have been personalized to the name of their custom field. If you installed the module exactly as I built it, the custom field will be named "customers_extrafield"

So, I think this would be the correct code instead. Give it a shot and see what happens :)

Add this code at line 28:

$oID = zen_db_prepare_input($_GET['oID']);
//start extrafield
$sql = "SELECT o.customers_id, c.customers_extrafield from " . TABLE_ORDERS . " o, " . TABLE_CUSTOMERS . " c WHERE c.customers_id= o.customers_id and o.orders_id = '" . $oID . "'";
$chk_customers_extrafield = $db->Execute($sql);
$customers_extrafield = $chk_customers_extrafield->fields['customers_extrafield']; 
//end extrafield

so now you can use the $customers_extrafield variable where you want, for example in one of the table cells:

<?php echo ENTRY_EXTRAFIELD; ?></b><?php echo ' ' . $customers_extrafield; ?>
9 Sep 2010, 11:57 AM
#7
eostre avatar

eostre

New Zenner

Join Date:
Apr 2005
Location:
Belgium
Posts:
47
Plugin Contributions:
0

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

And it worked!
Thank you so much!

3 Feb 2011, 10:24 PM
#8
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

Using V. 1.3.9, fresh install

Almost worked perfect for me, got this on the sign-up page:

EIN Number: (with a box)
ENTRY_EXTRAFIELD (box) ENTRY_EXTRAFIELD_TEXT

3 Feb 2011, 10:30 PM
#9
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

Cyndi,

Try step 3 of the installation process:

  1. Open the 2 language files and define the names of your new field:
    /includes/languages/english/extra_definitions/extrafield_defines.php
    /admin/includes/languages/english/customers.php
3 Feb 2011, 10:32 PM
#10
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

I'll try again, I thought I did that but I may have mistyped too...be right back and thanks for the awesome quick answer.

3 Feb 2011, 10:34 PM
#11
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

This is what I had in the extrafield_defines.php...should I also add it to the last one in this row too?

define('ENTRY_EXTRAFIELD', 'EIN:');
define('ENTRY_EXTRAFIELD_ERROR', 'Please answer Extra Field.');

if (EXTRAFIELD_REQUIRED == 'true') {
define('ENTRY_EXTRAFIELD_TEXT', '*');
} else {
define('ENTRY_EXTRAFIELD_TEXT', '');
}

3 Feb 2011, 10:35 PM
#12
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

In customers.php I had this for the field:

//start extrafield
define('ENTRY_EXTRAFIELD', 'EIN:');
//end extrafield

3 Feb 2011, 10:37 PM
#13
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

Hmm, that looks correct.

Do you have a link to your page so I can have a look?

3 Feb 2011, 11:17 PM
#15
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

Hmm, the language definition definitely missing somehow. Try re-uploading the language file to the server, see if that fixes it. In fact, you can try re-uploading the whole package (with your changes made).

3 Feb 2011, 11:19 PM
#16
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

Okay, and one other quick question, in the unzipped file you have under 1.3.8 another admin file...where should that go? I can't remember where I uploaded that now, I think to the main zc_admin directory.

3 Feb 2011, 11:30 PM
#17
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

No, didn't work. And got this for MYSQL patch:

Error Failed: 3
Error ERROR: Cannot ADD column customers_extrafield because it already exists.
Error ERROR: Cannot insert configuration_key "DISPLAY_EXTRAFIELD" because it already exists
Error ERROR: Cannot insert configuration_key "EXTRAFIELD_REQUIRED" because it already exists
Warning Note: 3 statements ignored. See "upgrade_exceptions" table for additional details.

3 Feb 2011, 11:42 PM
#18
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

That folder is for Zen Cart 1.3.8 users only, you can remove it from your site.

That SQL error is totally normal - you have already installed the fields, so cannot add them again.

Other than the text, is the field working OK?

When you sign up for account, does the input go to the customer's information inside your Zen Cart admin, as well as to the customer's My Account page?

3 Feb 2011, 11:49 PM
#19
cyndi avatar

cyndi

New Zenner

Join Date:
Jan 2011
Location:
US
Posts:
37
Plugin Contributions:
0

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

Yes, it goes in the customer detail for admin, but still comes out as the "customer" update my info as customer:

ENTRY_EXTRAFIELD ENTRY_EXTRAFIELD_TEXT

4 Feb 2011, 12:01 AM
#20
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

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

I would have to take a closer look at testing the code to see why it is not working on your site.

Instead, let's a do a quick fix like so... open /includes/templates/YOURTEMPLATE/tpl_modules_create_account.php

find this code:

<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo zen_draw_input_field('extrafield', '', 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>

replace it with this:

<label class="inputLabel" for="extrafield"><?php echo EIN; ?></label>
<?php echo zen_draw_input_field('extrafield', '', 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">*</span>': ''); ?>

You can do a similar replacement in the customer account file.