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

Additional Customers Fields

Locked

Views: 88,141

Results 121 to 140 of 491
This thread is locked. New replies are disabled.
4 Jun 2007, 12:42 PM
#121
esugrue avatar

esugrue

Zen Follower

Join Date:
Jun 2004
Posts:
182
Plugin Contributions:
0

Additional Customers Fields

If you go to your phpmyadmin, can you see this field settings created as is from your TABLE_CUSTOMERS ? Additionally, is that created field also added to the additional customers table as expected ?The field member_number is listed under both zen_customers and zen_customers_additional

If you expect to see the input type form from your admin customer's core page, then yes - it should be displayed with the content inside also if there are actually contents. If the content is empty, the routines has been coded to not display the field if there are no content inside.What I want is to allow the customer to input their member number when they create an account and for me to see/edit it if necessary on the admin side! I guess there will be no contents until I can get it working so I can create a test account and input a member number, so until then it won't be shown - correct?

Would it be possible to see what you edited in your template file - between the opening of while and the closing bracket of the while statement ? (Please post the codes in PHP bbcode, otherwise it's harder to read).
```php
while (!$account->EOF) {
if ($account->fields['field_name'] == "customers_hobbies") {
?>
<label class="inputLabel" for="customers_hobbies"><?php echo ENTRY_CUSTOMERS_HOBBIES_TITLE; ?></label>
<?php echo zen_draw_textarea_field('customers_hobbies', '45', '3'); ?>
<br class="clearBoth" />
<?php } // End of additional customers fields for hobbies. // We now set up an additional customer field for ages. if ($account->fields['field_name'] == "customers_age") { ?>
<label class="inputLabel" for="customers_age"><?php echo ENTRY_CUSTOMERS_AGE_TITLE; ?></label>
<?php echo zen_draw_input_field('customers_age', '', zen_set_field_length(TABLE_CUSTOMERS, 'entry_customers_age', '40') . ' id="customers_age"'); ?>
<br class="clearBoth" />
<?php } // End of additional customers fields for ages. // We now set up an additional customer field for member number. if ($account->fields['field_name'] == "member_number" && $temp != $account->fields['field_name']) { ?>
<label class="inputLabel" for="member_number"><?php echo ENTRY_MEMBER_NUMBER_TITLE; ?></label> <?php echo zen_draw_input_field('member_number', '', zen_set_field_length(TABLE_CUSTOMERS, 'member_number', '40') . ' id="member_number"'); ?>
<br class="clearBoth" />

<?php } // End of additional customers fields for member number. $account->MoveNext(); // Note: This shall be the only ending while loop with the variable: '$account' as there should only be one MoveNext() call with this variable as well. } ```I'm only really want the `member_number' part though, the last label > Sorry about that. As you can see, there are more than a few people who request assistance in here. I'm sure you can understand that I don't remember all of the specs for each of users.No, I don't expect you too, which is why I don't mind giving the specs again if it helps!
4 Jun 2007, 12:58 PM
#122
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

What I want is to allow the customer to input their member number when they create an account and for me to see/edit it if necessary on the admin side!

I guess there will be no contents until I can get it working so I can create a test account and input a member number, so until then it won't be shown - correct?

Incorrect. Your first phrase is correct. This MOD is programmed the way that, only from the admin's customers core page - the content must be filled before editing it. Otherwise, unless I'm mistaken, wouldn't it be useless to edit an empty field (especially if the customer does not wish to fill it out) ? :wink2:

However, from the store-end, the customer is supposed to see the empty field 'as long as you activated the field' (and as long as the customer did not really filled anything in it) as, for that, respected the IF condition from the examples I added from the TPL files of this package (and additionally incorporated the modules as is within your modules overrides files).

if ($account->fields['field_name'] == "member_number" && $temp != $account->fields['field_name']) {

Incorrect statement. Like I said before, do NOT use the $temp variable. This is useless.

The correct statement is:

if (isset($account->fields['member_number']) && $account->fields['field_name'] == "member_number") {

This is for the create account page.

if (isset($account->fields['member_number']) && $account->fields['field_name'] == "member_number" && $account->fields['field_status'] == 2) {

This is for the account edit page.

Both of these statements are clairly demonstrated from my package as I do not use the $temp variable anywhere. Please use as is.

4 Jun 2007, 1:03 PM
#123
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Note: I just edited my post above. I don't understand why but sometimes when I copy and paste codes to other bbcode functions, it does not paste the right function (just think you should know to avoid further confusions).

4 Jun 2007, 6:59 PM
#124
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: Additional Customers Fields

Dear Oracle,

I have just downloaded your MOD and am very excited about getting it up & running; I've been looking for this for a very long time!

Zen: 1.3.6
PHP: 4.4.4
MYSQL: 4.1.21.-standard

So -

  • uploaded files - No Problem
  • Ran SQL Statement - No Problem
  • Opened addt'l_cust_fields.php - got stuck here

I read the instructions 5 times and for some reason I'm not understanding your obviously very clear & concise instructions.

So - I did trial & error: First I entered:

<input type="text" name="Event_Date" value="">

which is what I thought you were instructing and got a parse error regarding the '<' when trying to refresh my Customer's page.

So, after commenting that out, then I looked at the bottom of the file and replaced > //$additional_customers_fields_form_input_title['customers_hobbies'] = array('Hobbies: ');

with

$additional_customers_fields_form_input_title['Event_Date'] = array('Event Date: ');

which did not produce any errors, nor did the additional fields display (They are 'turned on' )

I know it must be a simple oversight on my part and any assistance would be greatly appreciated.:ohmy:

Laura

4 Jun 2007, 7:23 PM
#125
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

$additional_customers_fields_form_input_title['Event_Date'] = array('Event Date: ');

This has been discussed earlier on the topic. Please do NOT enter capitalized letters.

$additional_customers_fields_form_input_title['event_date'] = array('Event Date: ');

This is how it should be. From your admin's add customers page, is it also showing uncapitalized ?

So - I did trial & error: First I entered:

Quote:
<input type="text" name="Event_Date" value="">
which is what I thought you were instructing and got a parse error regarding the '<' when trying to refresh my Customer's page.

Very vague text. Entered it where to result this error message ?

In the mean time, this error message means that you did not, either, close your PHP or did not re-opened the PHP tag in order to switch language over HTML. The proportion is not correctly done.

4 Jun 2007, 7:37 PM
#126
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: Additional Customers Fields

Thank you for your quick response.

I deleted the misnamed field and recreated event_date.

As I do not know how to write PHP from scratch, all I did was take out your comment slashes and re-insert my named field for yours.

Upon doing so I got this message:

Parse error: syntax error, unexpected '<' in /home/cvtldnad/public_html/zen/admin/includes/languages/english/extra_definitions/additional_customers_fields.php on line 22

when I entered:

<input type="text" name="event_date" value="your content">

and this message:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /home/cvtldnad/public_html/zen/admin/includes/languages/english/extra_definitions/additional_customers_fields.php on line 82

when I added: > $additional_customers_fields_form_input_title['event_date'] = array('Event Date: ');

Did I skip a step?
Am I supposed to add these two lines to generate a text field?

Thank you,
Laura

4 Jun 2007, 7:43 PM
#127
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Ah ! now I understand. You entered the HTML codes for the following inside the extra_definitions's file:

<input type="text" name="event_date" value="your content">

? If so, it is absolutely not required since I have facilitate the task even more easier for you. :wink2:

Meaning, this part has already been taken care of as you do not need to add them manually anymore. Each inputs corresponds with your additional customers fields keys. Which is why, the names must be identical.

$additional_customers_fields_form_input_title['event_date'] = array('Event Date: ');

This should be the line added / replaced with your additional customers fields called: event_date if you wish to show the input title. The content, from inside that file, is already taken care of by selecting any relative keys you added from the add customers fields page. As for the store-front, these fields must be justified within your template files (also by assuming you did followed the instructions on how to incorporate my modules within your overrides modules). Then, simply follow my IF conditions the way they were done from my package.

From there, all you need to do is to apply them for your fields. As easy as counting 1-2-3-4.

4 Jun 2007, 7:46 PM
#128
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: Additional Customers Fields

Thanks, Oracle.

I need to read this last reply a few dozen times, and then work it. I'll let you know if I still need help.

4 Jun 2007, 7:55 PM
#129
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Update:

New update version released from my site. For those who already installed it and needs to upgrade, make sure to follow the upgrade and changelog documentation.

Recall: Do NOT download from the downloads section of this site just yet - until you see the current date + v1.13 (both - MUST apply). For now, download it from my site as it would be less problematic for all of us. :wink2:

4 Jun 2007, 8:18 PM
#130
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: Additional Customers Fields

Okay - I'll take this step by step.

We left off my meandering thought the add'l fields php file. After your last post, I downloaded the package from your site and started again.

After uploading files and running the SQL statement, am I supposed to see these fields under "Additional Customer Fields" (which is showing) in one of the customer records? I'm not even worried about appearance in the front-end at this point. I just want to see it on the back end.

At this point, I do have the title of "Additional Customer Fields" but nothing else. The following is a piece of the add_cust_fiel.php file:

[QUOTE] Good luck !
//=========================================================================================================

$additional_customers_fields_form_input_title['event_date'] = array('Event Date: ');
//$additional_customers_fields_form_input_title['customers_age'] = array('Age: ');[\QUOTE]

I've printed out your instructions and I believe I've followed them (although from a non-coder's point of view, when you hand off form the install.txt (which has a nice step-by-step feel) to the follow instructions in the php file, it seems a bit vague...)

Thanks for your patience.
Laura

4 Jun 2007, 8:26 PM
#131
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

$additional_customers_fields_form_input_title['event_date'] = array('Event Date: ');

is your field (which should show as input from your admin's customers core page - admin - > customers - > customers).

//$additional_customers_fields_form_input_title['customers_age'] = array('Age: ');

is just an example field. It may be removed or replaced by your 2nd field name if you wanted to. The customers_age was just an example on how your fields would work (of course, if that fields really doesn't exists in your database. Otherwise, if it does, simply leave it there or ajust the form into the way you'd like to present it).

it seems a bit vague...

All instructions are within the additional_customers_fields.php of the admin's extra_definitions folder.

[ quote ] and [\QUOTE] ... hmm not using the right quotes ? :wink2:

4 Jun 2007, 8:37 PM
#132
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: Additional Customers Fields

Thanks again for your speed!:smile:

TheOracle:

is your field (which should show as input from your admin's customers core page - admin - > customers - > customers).

is just an example field. It may be removed or replaced by your 2nd field name if you wanted to. The customers_age was just an example on how your fields would work (of course, if that fields really doesn't exists in your database. Otherwise, if it does, simply leave it there or ajust the form into the way you'd like to present it).

Yes - understood - I included that just for comparison.

All instructions are within the additional_customers_fields.php of the admin's extra_definitions folder.


Yes - understood - I printed them out and have them here - but there is a ton of interesting commenting and it is hard to distinguish the 'steps to continue install' from the interesting comments.

[ quote ] and [\QUOTE] ... hmm not using the right quotes ? :wink2: I used the right quotes - it is not responding as before (???)

So basically, I'm still not seeing these at the customer core page. I get up to the instruction: "Go to your admin/....etc. to follow the rest of the instructions" and there I stay...

4 Jun 2007, 8:42 PM
#133
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

If you'd like, I can create a field for you from your site. Simply use the email from the installation package file and send me your infos (secondary admin account info, FTP info, site admin's URL).

Note: If you have installed the Admin profiles MOD, make sure to set full controls to the secondary admin account before I begin.

Thanks.

4 Jun 2007, 8:48 PM
#134
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Additionally, as mentioned before on this topic, if your field's content is empty (so, nothing on that field from your database), the field will not show up since it would be useless to show empty contents that your customers would not fill out.

4 Jun 2007, 9:06 PM
#135
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: Additional Customers Fields

Understood.

That is very generous of you. I hate being a complete failure at these things so I a going to invest some more time before I take you up on that.

4 Jun 2007, 9:39 PM
#136
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Email received and replied.

5 Jun 2007, 4:58 AM
#137
esugrue avatar

esugrue

Zen Follower

Join Date:
Jun 2004
Posts:
182
Plugin Contributions:
0

Re: Additional Customers Fields

Hi!

I have decided to try and re-install the module again as I cannot get it to work.

  • I want to create an additional field called member_number that will be 6 digits long that the customer can fill in when they create an account. It should default to 100000 and remain 100000 unless the customer changes it.
  1. In the Customers > Add Additional Fields
    what should I enter:

Name: member_number
Type: int
Size: 6
Attribute: [blank]
Default: 100000

will this work OK?

  1. I then go and edit /public_html/store/admin/includes/languages/english/extra_definitions/additional_customers_fields.php
    which currently reads, in part:
//$additional_customers_fields_form_input_title['customers_hobbies'] = array('Hobbies: ');
//$additional_customers_fields_form_input_title['customers_age'] = array('Age: ');
$additional_customers_fields_form_input_title['customers_cellphone'] = array('Cellphone: ');

// Additional Customers Fields - Form Type Table Structure (Textarea fields)
$additional_customers_fields_form_textarea_title['customers_hobbies'] = array('Hobbies: ');
//$additional_customers_fields_form_textarea_title['customers_age'] = array('Age: ');
//$additional_customers_fields_form_textarea_title['customers_cellphone'] = array('Cellphone: ');

// Additional Customers Fields - Form Type Table Structure (Select fields - title)
//$additional_customers_fields_form_pull_down_title['customers_hobbies'] = array('Hobbies: ');
$additional_customers_fields_form_pull_down_title['customers_age'] = array('Age: ');
//$additional_customers_fields_form_pull_down_title['customers_cellphone'] = array('Cellphone: ');

//$additional_customers_fields_form_pull_down_content['customers_hobbies'] = array("test1");
$additional_customers_fields_form_pull_down_content['customers_age'] = array(18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99);
//$additional_customers_fields_form_pull_down_content['customers_cellphone'] = array("test3");

//$additional_customers_fields_form_radio_title['customers_hobbies'] = array("Hobbies: ");
//$additional_customers_fields_form_radio_title['customers_age'] = array("Age: ");
//$additional_customers_fields_form_radio_title['customers_cellphone'] = array("Cellphone: ");

//$additional_customers_fields_form_radio_content['customers_hobbies'] = array("Test1");
//$additional_customers_fields_form_radio_content['customers_age'] = array("Test2", "Test4", "Test6");
//$additional_customers_fields_form_radio_content['customers_cellphone'] = array("Test3");

What can I edit/reduce this to for my member_number example above?

I know I then need to edit more files, but I wan to try and get this first step done first.

Ernie

5 Jun 2007, 10:59 AM
#138
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

What can I edit/reduce this to for my member_number example above?

Very vague question. For which form type would you like to set your field ? Since you create the field with int 6, it could be one of three types of forms on the arrays list. More details please.

5 Jun 2007, 11:40 AM
#139
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Additionally from the above, was the field creation successful with the specifications you mentioned ?

5 Jun 2007, 11:41 AM
#140
esugrue avatar

esugrue

Zen Follower

Join Date:
Jun 2004
Posts:
182
Plugin Contributions:
0

Re: Additional Customers Fields

TheOracle:

Very vague question. For which form type would you like to set your field ? Since you create the field with int 6, it could be one of three types of forms on the arrays list. More details please.

  • I want to create an additional field called member_number that will be 6 digits long that the customer can fill in when they create an account. It should default to 100000 and remain 100000 unless the customer changes it.

So I want the customer to see:

Member Number:

and then a box to fill in (a text box I guess), with 100000 already there and they will overwrite that number with an existing member number if they have it.

I don't know how else to explain it.. like here:

http://www.oongo.com/add.htm

Additionally from the above, was the field creation successful with the specifications you mentioned ?

  • Yes it was