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

Additional Customers Fields

Locked

Views: 88,139

Results 441 to 460 of 491
This thread is locked. New replies are disabled.
12 Sep 2007, 9:01 PM
#441
creative avatar

creative

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Additional Customers Fields

Danebrood,

No, the creator of this Mod is no longer supporting it. The only documentation I have is his last revision, v2.52. Let me know if you'd like those files.

13 Sep 2007, 4:27 AM
#443
stage avatar

stage

New Zenner

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

Re: Additional Customers Fields

Danebrood:

Hey all,

Am I correct in understanding that there is no one maintaining this mod currently?

I just finished installing it, and after some playing around and bug squelching, got it working fine. If there is no one currently keeping it up, I'll volunteer. Probably about time I start giving something back to Zen Cart community. :blush:

If there is someone maintaining it and there's a repository of documentation or updated code, can someone pass me the link? I could at the very least submit some patches for the latest version and a more thorough set of instructions for installation and customization. It's a wee bit tedious searching through this 44 page and counting thread.

thanks,

The beauty of open source code is that you can do whatever you want :)

I actually got into a long email discussion with the original developer of this mod. I would say most of the issues with this mod are related to the author not speaking English as his first language as well as some cultural differences. For example it took me a couple of emails to make it clear to him that I wasn't being critical, rather just looking for some further understanding.

There are things in teh documentation, as well as some things missing that I think cause most of the issues here.

I've worked with several different open source applications, I think that while the end goal of ZC is good from the core developers stand point, it is a little more complex, at least from the aspect of trying to understand it than most.

For the most part I feel the developer of this mod did try to follow those standards, there were a few places he did not if memory serves me. It is complex and there are a number of files involved.

Why he is no longer actively supporting the mod remains a mystery to me. He was certainly taking an interest when I exchanged emails with him about a month ago.

stage

13 Sep 2007, 7:27 PM
#444
danebrood avatar

danebrood

New Zenner

Join Date:
Sep 2007
Posts:
7
Plugin Contributions:
0

Re: Additional Customers Fields

After altering the code quite a bit yesterday, I'm not sure if releasing an updated version of TheOracle's mod is the way to go. I've removed some parts that were causing headaches, and changed some parts so drastically that there wouldn't be any continuity between mine and what people are currently using out there.

I'm going to put together a new, less ambitious mod for the purpose of adding customer account attributes and see how that goes. It's a great idea, and examing all the work TheOracle put into this one, I have a great idea how I'd do it. In the meantime, if people need help solving problems with this mod, i'll keep in the thread and try and help (along with the others currently troubleshooting).

14 Sep 2007, 12:39 AM
#445
stage avatar

stage

New Zenner

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

Re: Additional Customers Fields

If you have managed to come up with a mod that is not quite as complex I would say it would be of benefit to zenners. Since you appear to going down a different path, I don't know what the policy is here as in should it be a new version or a whole new mod?

stage

14 Sep 2007, 12:55 PM
#446
creative avatar

creative

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Re: Additional Customers Fields

stage:

There are things in teh documentation, as well as some things missing that I think cause most of the issues here.

I completely agree with this. The instructions for this mod weren't very clear at all. I didn't even understand how the mod worked until theOracle answered a slew of my (probably annoying) questions. After understanding how he had intended the mod to work, I had even thought of volunteering to rewrite the directions if it was finalized.

I understand the main reason for the confusion is probably not speaking English as a native language. However, clear directions for any mod is very important for those of us that aren't PHP programmers.

Danebrood, please let me know if I can in any way help test your revisions. I think this mod would make a whole lot of Zenners super-happy.

26 Sep 2007, 5:35 PM
#447
ox_team avatar

ox_team

New Zenner

Join Date:
Feb 2005
Location:
Belarus
Posts:
52
Plugin Contributions:
1

Re: Additional Customers Fields

I don't know where to post it, so I post here.
Here's small fix to file /includes/modules/your_template/create_account.php from version 2.55.
There was sql error during customer registration.
May be it is already fixed, I didn't have a time to look through all 45 pages of discussion.
Patch:

--- create_account.old.php      2007-07-05 10:18:38.000000000 +0000
+++ create_account.php  2007-09-26 20:26:57.000000000 +0000
@@ -308,7 +308,7 @@
           } // End of foreach statement.
       } // End of if statement.
       if (isset($additional_sql) && !empty($additional_sql)) {
-      $additional_sql .= substr($additional_sql, 0, strlen($additional_sql) -2);
+      $additional_sql = ', ' . substr($additional_sql, 0, strlen($additional_sql) -2);
       } // End of if statement.

     $sql = "update " . TABLE_CUSTOMERS . "
17 Oct 2007, 1:38 AM
#448
darkgamer avatar

darkgamer

New Zenner

Join Date:
May 2007
Posts:
14
Plugin Contributions:
0

Re: Additional Customers Fields

Another bug found... man this one drove me crazy... if you're getting this error 500:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log....AND you have this mod installed... AND your logs say this:

[Tue Oct 16 17:32:53 2007] [error] [client 66.214.30.209] malformed header from script. Bad header=No recipient addresses found i: /(zen cart directory)/index.phpgo edit order.php and comment out the following lines that this MOD had you add... (assuming you don't need that info in the confirmation e-mail)

for me it was lines 1013-1040:

    //-------------------------------------------------------------------------------------------
    //--- Additional customers fields begins here -----------------------------
    //-------------------------------------------------------------------------------------------    
    $html_msg['EMAIL_FIRST_NAME'] = $this->customer['firstname'];
    $html_msg['EMAIL_LAST_NAME'] = $this->customer['lastname'];    
    //  $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER;
    $html_msg['EXTRA_INFO'] = '';    
    if (@file_exists(DIR_WS_CATALOG . DIR_WS_INCLUDES . 'extra_configures/mods/additional_customers_fields/order_confirmation_email/additional_customers_fields.php')) {
        $additional_customers_fields_email_entries = @include_once(DIR_WS_CATALOG . DIR_WS_INCLUDES . 'extra_configures/mods/additional_customers_fields/order_confirmation_email/additional_customers_fields.php');                        
    } // End of if statement.
    if (isset($additional_customers_fields_email_entries)) {        
        $email_order .= $additional_customers_fields_email_entries;                
    } // End of if statement.
    zen_mail($this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id, $email_order, STORE_NAME, EMAIL_FROM, $html_msg, 'checkout');    
    //-------------------------------------------------------------------------------------------
    //--- End of additional customers fields. ------------------------------------
    //-------------------------------------------------------------------------------------------  
```For those of you brave enough to tackle this MOD, the best of luck to you.... it seems like it could be quite handy if it worked and had clear instructions... 

Many thanks to Luca for resolving the majority of issues in one post (#415 on this thread) and DrByte for providing some of his precious time to help out his fellow zenners. *tips hat*
6 Feb 2008, 1:54 AM
#449
jamie2k avatar

jamie2k

New Zenner

Join Date:
Oct 2006
Location:
Suffolk UK
Posts:
55
Plugin Contributions:
1

Re: Additional Customers Fields

Hi Folks :)

I have just spent about 15 - 20 hours on this mod, banging my head against the wall... Great Idea !!! but very hard to follow the instructions and i have to say i feel, after reading all 45 pages, a little sorry for TheOracle, who only did his best...

I strongly believe that this MOD should not be available to download without some very BOLD warnings about the level of skill and reading between the lines needed to get working.

I have the MOD allowing me to add additional feilds in the adminn and they appear in the db; although it is still not working and is returning blank in admin customer edit and create account.

I am reverting to backup... very dissapointed :(

Hope someone can help get this to a stage where its installable

Jamie

19 Dec 2008, 2:54 PM
#450
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Additional Customers Fields

i got it working enough for my client, pm me if you want more details

25 Dec 2008, 1:12 AM
#451
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Additional Customers Fields

assuming you have followed the installation instructions and merged all needed files, finished the installation to be left broken, try this:

**Step 1: add missing table fields:
**

that should fix ur mysql errors so u can atleast look at tha admin cfg page. now u can use the "Add Customer Fields" link.

go in there and create your new fields, starting with just one called test_field (VARCHAR) to begin, (get the system working first)

this will add the new fields to your db tables, but u still need to setup your forms:

**Step 2: add new fields to your admin customer pages:
**

editing additional_customer_fields.php at the bottom allows you to specify the new fields you have and the style/size etc that they are presented with in your admin customers pages.

by default youll have one named test_field, as a textarea box, this will line up with the test_field varchar we just created in step 1. so u can later once we get this one working add all types of inputs.

heres mine as example:

this gives a basic rectangular textarea box

$additional_customers_fields_form_textarea_title['test_field'] = array('Company Details: ');

$additional_customers_fields_form_textarea_length['test_field'] = array("50", "70", "5");

this gives a two choice radio button

$additional_customers_fields_form_radio_title['test_field2'] = array("Apply for Wholesale: ");

$additional_customers_fields_form_radio_content['test_field2'] = array("Yes", "No");

you can see more examples commented out in that file

at this stage you should be able to go to your customer pages, and see at the bottom your new fields

**Step 3: add new create <INPUT> fields:
**

now for the fun bit, u can do this for both edit and create forms, i just did create, as the field data i was collecting i didnt need edited later...

the file we begin with is tpl_modules_create_account.php and it will have a demo field called "test_field" (labeled as email address for some reason)

at this point you can actually test the system and it should work, you should have an extra field in your create account form (labelled wrongly) but it should work, save the input and show it in the admin section for that customer.

but your going to want to customize it so here mine as example: (this is just the section to edit near the bottom of the file:

also note this isnt the simplest example, as it has javascript to enable/disable the textarea input box depending on the radio buttom choice :)

hopefully it can show you what to do, otherwise just ask.

<?php

// Additional customers fields.

if ($customersFields->countFields() > 0) {

	



        ?>

<SCRIPT TYPE="text/javascript">

<!--

function whole(status)

{

	

if(status){

document.getElementById("test_field").style.background='white';

document.getElementById("wyes").checked = true

document.getElementById('test_field').focus()

}

else{

document.getElementById("test_field").style.background='#BDBDBD';	

document.getElementById("test_field").value=''	;

}



}

//-->

</SCRIPT>

        

        <fieldset>

        <legend>Request Wholesale:</legend><br />

        <?php echo 

        

        zen_draw_radio_field('test_field2', '2','1' ,'id="wno" onClick="whole(0)"') . 

        

        '<label class="radioButtonLabel" for="email-format-html">No</label>' . 

        

         zen_draw_radio_field('test_field2', '1','' , 'id="wyes" onClick="whole(1)"') .

         

          '<label class="radioButtonLabel" for="email-format-text">Yes</label>';

          

           ?>

          <br />

          

<br class="clearBoth" />

        

        

        

        <label class="inputLabel" for="test_field">Company Details:</label>

        <?php echo zen_draw_textarea_field('test_field', 20, 5, '', ' id="test_field" onClick="whole(1)" style="width: 400px; margin-left:130px;background-color:#BDBDBD"' ); ?>

        <br class="clearBoth" /></fieldset>

        <?php

    }   



// End of additional customers fields.

?>

**Step 4: add new edit <INPUT> fields:
**

as i mentioned earlier the xtra content im collecting doesnt need to be edited or viewd by the customer after submission so i removed the fields in tpl_account_edit_default.php , if u want them edit as needed , i imagine in a similar fashion to how we just did in step 4.

good luck, (theres likely something i missed, so just let me know when it doesnt work)

hayden.:wink:

(merry christmas)

additional admin fields: ("Add Customer Fields" page)

additional admin customer fields:

additional db fields (added by the admin forms)

additional customer account creation inputs:

8 Mar 2009, 1:35 AM
#452
briskday avatar

briskday

New Zenner

Join Date:
Sep 2007
Posts:
18
Plugin Contributions:
0

Re: Additional Customers Fields

Just tried the 3-0 version of this mod, I was able to get the test_field operating as a text field without problems. Has anyone been able to create a drop down menu with this?

I understand all of the changes needed except the code that goes on the template pages:
tpl_account_edit_default.php
tpl_modules_create_account.php

I read through every post in this branch and tried the following:

// We now set up an additional customer field for sales representative.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "test_field") {
echo add_customers_fields_for_create_account('test_field', 'zen_draw_pull_down_menu');
} // End of additional customers fields for ages.

nothing shows up
do you have to hard code the values in these pages? I thought that's what the 'additional_customer_fields.php' page was for...to store the values...?

Ideally I would like to pull the values from another custom table. These values would be charities that customers can choose and proceeds from their purchases will go to their selected organization.

any advice would be greatly appreciated

8 Mar 2009, 8:55 AM
#453
briskday avatar

briskday

New Zenner

Join Date:
Sep 2007
Posts:
18
Plugin Contributions:
0

Re: Additional Customers Fields

follow up:

I was able to get a functioning custom customer drop down with this code in the tpl files

// Additional Customers fields.***************************************
if ($customersFields->countFields() > 0) {
    if ($customersFields->isActive('test_field')) {
		$selected = $account->fields['test_field'];
		
		$pulldown_query = "select organization_id, name from organizations where status_id = 2 order by name";
  }

  $pulldown = $db->Execute($pulldown_query);

  if ($pulldown->RecordCount()>0) {
    $number_of_rows = $pulldown->RecordCount()+1;

// Display a list
    $pulldown_array = array();
    if (!isset($_GET['orgainization_id']) || $_GET['organization_id'] == '' ) {
      $pulldown_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    } else {
      $pulldown_array[] = array('id' => '', 'text' => PULL_DOWN_ORGANIZATIONS);
    }

    while (!$pulldown->EOF) {
      
      $pulldown_array[] = array('id' => $pulldown->fields['organization_id'], 'text' => $pulldown->fields['name']);

      $pulldown->MoveNext();
    }
    ?>    
        <fieldset>
        	<legend>Select an organization</legend>
            Choose the organization you would like to support with your purchases.<br />
        <?php echo zen_draw_pull_down_menu('test_field', $pulldown_array, $selected, 'id="select-org"'); ?>
        </fieldset>    
    <?php    
    }
}
// End of additional customers fields.********************************

there is probably a better way to do it but it works for me

9 Mar 2009, 12:46 AM
#454
anitab avatar

anitab

New Zenner

Join Date:
Feb 2009
Posts:
50
Plugin Contributions:
0

Re: Additional Customers Fields

I am uploading Additional Customers Fields v3.0 as a new install. The instructions indicate to upload the following file into my zen cart shopping cart:

includes/languages/english/additional_customers_field.php

but that file is not in the v3.0 add-on files I downloaded...?

Files with the same name are located in other folders in the v3.0 download:

admin/includes/functions/extra_functions/
admin/includes/languages/english/
admin/includes/languages/english/Extra_definitions/

I have downloaded them as the instructions indicate. Is there an error in the Additional Custormers Field v3.0 instructions regarding the file that they indicate is located at includes/languages/english/additional_customers_field.php?

31 Mar 2009, 12:23 PM
#455
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Additional Customers Fields

hows it going anyone still having troubles ??

11 Apr 2009, 10:20 AM
#456
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Additional Customers Fields

i should just add that step 2 refers to the additional_customers_fields.php file located in \admin\includes\languages\english\extra_definitions

12 Apr 2009, 10:15 PM
#457
anitab avatar

anitab

New Zenner

Join Date:
Feb 2009
Posts:
50
Plugin Contributions:
0

Re: Additional Customers Fields

Hayden!

Thank you So, So, So VERY MUCH for the offline support you have given me!!! You really hung in there with me - was extremely patient, and put in a lot of time. The additional fields add-on is now Finally working perfectly!!

You are Terrific and an extremely valuable resource!! :clap::bigups::clap:

My best to you,
Anita

12 Apr 2009, 11:54 PM
#458
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Additional Customers Fields

:) , thats ok, you deserve some credit too for sticking it out when it didnt work straight away.

27 May 2009, 3:50 PM
#459
frankderosa avatar

frankderosa

New Zenner

Join Date:
Jan 2009
Location:
Charlottesville, VA
Posts:
51
Plugin Contributions:
0

Re: Additional Customers Fields

hayden:

hows it going anyone still having troubles ??

Yeah, this guy.

I have followed the instructions as supplied in the mod (using the v3.0 and I am getting a fatal error referencing class.base.php being defined already, on the customer side. I have the admin side working, to my knowledge. Any thoughts?

Thanks,
Frank

27 May 2009, 5:22 PM
#460
frankderosa avatar

frankderosa

New Zenner

Join Date:
Jan 2009
Location:
Charlottesville, VA
Posts:
51
Plugin Contributions:
0

Re: Additional Customers Fields

By the way, I believe the following query will get you a working table with all the fields included:

CREATE TABLE IF NOT EXISTS `zen_customers_additional` (
  `field_id` int(11) NOT NULL AUTO_INCREMENT,
  `field_name` varchar(255) NOT NULL DEFAULT '',
  `field_status` char(2) NOT NULL DEFAULT '',
  `field_date` date NOT NULL,
  `field_required` int(11) NOT NULL,
  `use_url` varchar(255) NOT NULL,
  `field_url` varchar(255) NOT NULL,
  `field_url_name` varchar(255) NOT NULL,
  PRIMARY KEY (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

This uses the zen_ table prefix; you may need to adjust this or remove it if you don't use table prefixes. Also, this inserts the whole table. If you already inserted the 3 fields the instructions specify, you'll want to drop the table, then use this.

Frank