Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customers extra fields


kit

Recommended Posts

Great Contribution .. I ran into a problem with the customers page not showing up in the admin?? it doesn't give any errors just blank.. not sure what's up.. anyone have any Ideas. I went through the install file twice to double check and I seam to not have missed anything..

Link to comment
Share on other sites

Hi ther, 1st of all congratulation for this nice contribution

 

May I add, that if you use Admin Access level, you should add the file extra_fields.php manually in the table admin_files .... Otherwise, You'll end up with an access not allowed error...

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,

 

I was wondering if it was possible to get the extra fields data into the order confirmation email. That would be really useful. Should be done in the checkout_process.php. I have already inserted phone number and email, but I am having problems with the fax no and the extra fields.

 

Any help will be appreciated.

 

B. regards,

compuskill

Link to comment
Share on other sites

  • 2 weeks later...

Nice job! The only errors in the code where the break tags in a few pages, easy to fix and working great! I love that all code was added rather than modifying core code. My site is so heavily modified it's very difficult to use most contributions.

 

I was actually hoping to find a way to include uploading an image into the account information. I haven't had any luck so far. I can write a simple script that opens in a new window and allows them to upload their "bio" photo to a folder on the server, but I want to at least have the filename attached to their customer info when they place an order. Anyone have any suggestions?

Link to comment
Share on other sites

HI, just installed it and found a small error at instruction 10

 

<?echo tep_get_extra_fields($cInfo->customers_id,$languages_id)?>

 

should be

 

<?php echo tep_get_extra_fields($cInfo->customers_id,$languages_id)?>

 

minor i know but if kit could fix it as it would confue newbies

 

thanks

 

ps: i used the 15/10/07 EXTENDED download

Link to comment
Share on other sites

  • 2 weeks later...

Hi!!

 

Thank you for these great application... I am having a trouble in my checkout_confirmation.php file and is sending me the next error message:

 

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/plastica/public_html/clientes/includes/functions/general.php on line 42

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/plastica/public_html/clientes/includes/functions/general.php on line 42

Forma de Pago (Cambio)

 

Wahto could be the problem

 

 

Thank you!!!

Link to comment
Share on other sites

  • 2 weeks later...

I have problem with Customer extra filelds

 

4. In catalog/includes/form_check.js.php

 

check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");

 

add after

 

<?php

$extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_required_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id);

while($extra_fields = tep_db_fetch_array($extra_fields_query)){

$string_error=sprintf(ENTRY_EXTRA_FIELDS_ERROR,$extra_fields['fields_name'],$extra_fields['fields_size']);?>

check_input("<?php echo 'fields_' . $extra_fields['fields_id']?>", <?php echo $extra_fields['fields_id']-1;?>, "<?php echo $string_error; ?>");

<? }?>

 

 

But when I try create my account, I have this error

 

Parse error: syntax error, unexpected $end in c:\*\*\www\catalog\includes\form_check.js.php on line 151 ( line 151 after //--></script>)

Link to comment
Share on other sites

  • 4 weeks later...

has anyone worked out how to add the extra fields to the order editor or the invoice? I have read over the entire post and seen that there have been many requests for this. I have tried Duende's hack but it does not work for me?

 

please help I am keen for a proper hack to make this happen.

Link to comment
Share on other sites

Hello,

 

I have similar problem but it is basically seems with one of the tables. When I try to regsiter, it gives me this error messge:

 

 

 

1146 - Table my_database_name.address_book' doesn't exist

 

select entry_country_id, entry_zone_id from address_book where customers_id = '2' and address_book_id = '0'

 

[TEP STOP]

 

 

 

I appreciate your help

Link to comment
Share on other sites

Hi all,

 

this patch applies on the last patch made by Agelmar for a new vanilla installation

to make selectable the extra fileds occurencies in the advanced search page :)

 

I NEED AN HELP ON HOW TO IMPLEMENT AN "AND" SELECT WITH THE EXTRA FIELDS VALUE

(EG. SHOW AL THE PRODUCTS CORRESPONDING TO 1° EXTRA FIELD VALUE "AND" 2° EXTRA FIELD VALUE "AND" SO ON...)

ACTUALLY IT DOESN'T WORK ON MY DEVELOP SERVER :huh:

 

LET ME KNOW

THX

DAVID :thumbsup:

 

 

you will finish up with: OSC VANILLA rc2a + v2.0j in patch format + PEF Search Extra Fields + PULL DOWN MENU SEARCH

 

after both the patches were applied comment first bold and add the second bold in ADVANCED_SEARCH.PHP:

 

// START: Extra Fields Contribution Search Fields 1.0

$pef_fields = tep_db_query("SELECT products_extra_fields_id, products_extra_fields_name FROM products_extra_fields WHERE languages_id = " . (int)$language . " AND products_extra_fields_status ORDER BY products_extra_fields_order");

while ($field = tep_db_fetch_array($pef_fields))

{

?>

<tr>

<td class="fieldKey"><?php echo $field['products_extra_fields_name']; ?></td>

<!-- <td class="fieldValue"><?php // echo tep_draw_input_field('pef_'.$field['products_extra_fields_id'], '', 'style="width: 300px"'); ?></td> -->

 

<td class="fieldValue"><?php echo tep_draw_pull_down_menu('pef_'.$field['products_extra_fields_id'], tep_get_extra_fields_value(array(array('id' => '', 'text' => TEXT_ALL_EXTRA_FIELDS_VALUES)),$field['products_extra_fields_id'])); ?></td>

 

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

// END: Extra Fields Contribution

 

ADD THIS FUNCTION IN GENERAL.PHP:

 

// START: Extra Fields Contribution Search Fields 1.0 WITH PULL DOWN MENU

function tep_get_extra_fields_value($extra_fields_array = '', $id) {

if (!is_array($extra_fields_array)) $extra_fields_array = array();

 

$extra_fields_query = tep_db_query("select distinct products_extra_fields_id, products_extra_fields_value from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE `products_extra_fields_id` = " .$id. " order by products_extra_fields_value ASC");

while ($extra_fields_values = tep_db_fetch_array($extra_fields_query)) {

$extra_fields_array[] = array('id' => $extra_fields_values['products_extra_fields_value'], 'text' => $extra_fields_values['products_extra_fields_value']);

}

 

return $extra_fields_array;

}

// END: Extra Fields Contribution WITH PULL DOWN MENU

eBay certified API developer - Google Adwords API developer - OSC developer - SEO consultant - Italian, Rome based

Link to comment
Share on other sites

Hi

 

A really essential and promising contribution. However, I have been having difficulties in making it work.

 

I am stuck at the moment with this error:

 

Parse error: syntax error, unexpected T_VARIABLE, expecting ')' in /content/StartupHostPlus/t/r/trackdaymagazine.com/web/shop/catalog/admin/extra_fields.php on line 192

 

This is my line 192:

 

			$contents[] = array('text' => '<br>' . TEXT_FIELD_REQUIRED_STATUS . '<br>' . tep_draw_radio_field('fields_required_status', 0, ($fInfo->fields_required_status==0) ? true : false) . 'false<br>' . tep_draw_radio_field('fields_required_status', 1, ($fInfo->fields_required_status==1) ? true : false) . 'true');

 

and I just can't figure what the fault is.

 

I have to add at this point that I am a complete newbie to this including php and perhaps out of my depth, but I thought I'd give it a go.

 

Any help gratefully received.

Edited by trackdaymagazine
Link to comment
Share on other sites

  • 4 weeks later...

I have installed the original contribution and then installed v1.2a rollup. My situation is as follows.

 

My site is in two lanquages "english default and dutch". I have completed all the necessary translations for both frontend as well as backend.

 

My first problem: Admin

 

In the extra fields admin control panel when adding a new field or editing an existing field. the fields name imput box has an enlish and dutch imput field as it should. But once I complete all fields and save or update, all information is saved correctlly minus dutch name input box. It has been cleared.

 

My second problem: Catalog

 

In create account, english side, all extra fields box'es are there and work correctlly. as well as in account edit. But they are not showing up on ether create account or account edit pages on the dutch side. All other funtions are working correctlly.

 

I did not see where anyone has had this problem or notice anything wrong with the scripts. but I must have missed something. Possibly someone has seen this and has a solution. :blink:

Link to comment
Share on other sites

  • 3 weeks later...

HEllo / French user of this fantastic contribution.

 

My problem :

 

1054 - Unknown column 'fields_id' in 'field list'

 

insert into customers (customers_id, fields_id, value) values ('68', '1', 'rene')

 

[TEP STOP]

Link to comment
Share on other sites

  • 1 month later...

On installation it says at this part -

check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");

 

enter this part

 

 <?php
  $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_required_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id);
  while($extra_fields = tep_db_fetch_array($extra_fields_query)){
  $string_error=sprintf(ENTRY_EXTRA_FIELDS_ERROR,$extra_fields['fields_name'],$extra_fields['fields_size']);?>
   check_input("<?php echo 'fields_' . $extra_fields['fields_id']?>", <?php echo $extra_fields['fields_id']-1;?>, "<?php echo $string_error; ?>");
<? }?>

 

 

 

Once i put this in and it looks like this...

 

check_password("password", "confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_ERROR_NOT_MATCHING; ?>");
 check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");
  <?php
  $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_required_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id);
  while($extra_fields = tep_db_fetch_array($extra_fields_query)){
  $string_error=sprintf(ENTRY_EXTRA_FIELDS_ERROR,$extra_fields['fields_name'],$extra_fields['fields_size']);?>
   check_input("<?php echo 'fields_' . $extra_fields['fields_id']?>", <?php echo $extra_fields['fields_id']-1;?>, "<?php echo $string_error; ?>");
<? }?>

 

I get this error when loading up the create account Screen - Parse error: syntax error, unexpected $end in C:\wamp\www\fresh2\catalog\includes\form_check.js.php on line 143

 

 

 

Can anyoe help?

Link to comment
Share on other sites

  • 2 weeks later...
Admin can add/edit/delete extra fields for customers and set up field name, field type (input field, textarea field) and field required status (true, false). Customers see extra fields when he create or edit own account.

 

If you have any queries, bug reports, praise or derision, don't hesitate.

 

A really great addition and something definitely needed in the basic package ASAP. The installation was not flawless, but working great now. Recognize I am a relative Linux newbee so view my comments from that perspective.

1. The job killer in items 5 and 7 was the including of <br><br> at the end of both statement additions. The script would not run on my machine with Firefox v3.01. Deleted them and all worked as expected and desired. Found suggestions in a number of the comments indicating these carriage returns should be deleted, but didn't get the idea the script just wouldn't run if they were there. I thought the including was a final report format thing.

 

The rest of these were points of confusion probably a function of my lack of experience on this type a thing rather than as indicating a problem. Clarification might be indicated however:

2. In item 3 where the file addition should be made wasn't clear to me. It appeared the files should be under /admin/includes/language/as indicated though /admin/includes/language/english/ seemed more logical. I put it in both places reasoning an extra couldn't hurt, but not available where needed would be a show stopper.

3. In item 9 the specified folder noted as /function/ didn't exist but /functions/ did. That worked.

4. In item 10, 13 and 15 the statements to be added seemed to require:

<tr>

<td>Statement</td>

<tr>

to be consistent in format with the code in that area. Added it and worked OK. Can't say it wouldn't have worked without the added format element additions, but working now and I go with if it works leave it alone.

 

All admittedly minor things, but this update is so valuable and so close to perfect as presented, I though some nit picking was in order. All that said, just an awesome job guys. Thanks.

 

Hal

Link to comment
Share on other sites

Hal

 

Have you thought of making the changes to the installation instructions and uploading a corrected contribution.

 

It is only when things are tested in the wild that these errors can be corrected.

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

Thanks for this contribution, its really great.

 

But I need that field to display in shipping address & billing address, Could you please help me how to add that contribution in that shipping and billing address pages.

 

Looking forward your earlieat response will be highly appreaciated

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I need to make account creation form to go for payment if i choose membership option

I can achive up to addition of extra field by the help of this contribution

but can anybody tell me how to pass this info directly to the order form without any obstacles in it will be very much helpfull.

can any body give me the code needed for it

Its very urgent help me please

Regards & Thanks in advance

 

Anil

Link to comment
Share on other sites

Hal

 

Have you thought of making the changes to the installation instructions and uploading a corrected contribution.

 

It is only when things are tested in the wild that these errors can be corrected.

 

G

 

Did think about it, but because of my novice status, I was hoping my comments would trigger the moderator or contribution prime author to do the update. My groping approach, though it worked for me, may not be the best answer.

 

I am flattered you would suggest it. Thanks.

Link to comment
Share on other sites

Hi!

I think that you miss point 6 from installation instruction:

6. In admin/includes/database_tables.php

Add the following lines:

define('TABLE_EXTRA_FIELDS','extra_fields');

define('TABLE_EXTRA_FIELDS_INFO','extra_fields_info');

define('TABLE_CUSTOMERS_TO_EXTRA_FIELDS','customers_to_extra_fields');

or you miss point 11:

11. In catalog/includes/database_tables.php

Add the following lines:

define('TABLE_EXTRA_FIELDS','extra_fields');

define('TABLE_EXTRA_FIELDS_INFO','extra_fields_info');

define('TABLE_CUSTOMERS_TO_EXTRA_FIELDS','customers_to_extra_fields');

Check pleas these points and tell me result. If you have any

questions, don't hesitate - ask me.

Regards.

Marat.

 

--------------------------------

Either I am on the wrong version or I am just missing something.

 

1. I do not have this database_tables.php or the filename.php file.

I am using version oscommerce-2.2rc2a and I also have the add on for the registry feature.

Note: I did get around the issues with that by plugging those variables in the application_top.php file.

 

2. I also was not able to implement the changes for (13 In catalog/create_acount.php)

My file did not have what it told me to look for.

 

3. I was able to get the admin side working but I cannot see the additional fields on the user side.

 

Any assistance would be appreciated because this looks like an add on that will use multiple times. Once I get all figured out I will put it in a self-extracting zip file so it speeds things up.

Link to comment
Share on other sites

  • 3 weeks later...

Fix for

 

get this error when loading up the create account Screen - Parse error: syntax error, unexpected $end in C:\wamp\www\fresh2\catalog\includes\form_check.js.php on line xxx

 

Change this

 

<? }?>

 

To this

 

<?php }?>

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I have problem with Customer extra filelds

 

4. In catalog/includes/form_check.js.php

 

check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");

 

add after

 

<?php

$extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_required_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id);

while($extra_fields = tep_db_fetch_array($extra_fields_query)){

$string_error=sprintf(ENTRY_EXTRA_FIELDS_ERROR,$extra_fields['fields_name'],$extra_fields['fields_size']);?>

check_input("<?php echo 'fields_' . $extra_fields['fields_id']?>", <?php echo $extra_fields['fields_id']-1;?>, "<?php echo $string_error; ?>");

<? }?>

 

 

But when I try create my account, I have a blank page with NO output error.

 

regards,

Link to comment
Share on other sites

  • 1 month later...

What I would like is to be able to have hidden fields as part of this mod.

 

I require to have 3 extra fields available and shown to the customer on creating and modifying their account, but to also have 3 fields made available on the admin customer edit page but not available to customers.

 

For now I've just removed the code from create_account and edit_account to have the 3 hidden fields working as I require, but this does not allow me to have any fields shown to the customer to fill in.

 

I could do with someone giving me a quick way of editing the code placed in those two files to allow me to select which fields to show to the customer, and which to hide for admin only. I'm assuming the easiest way would be a simple 'if' wrapped around the loop of code displaying the fields on those pages, and only selecting the field ID's I want shown.

 

Obviously to have an extra field on the extra fields manager page for "admin only" or "hidden field" would be great, adding a new column to the field properties in the db, which can then be used in the if clause when displaying the new fields to customers would be the best way. Possibly something for the mod author to think about? It would finish this mod of very well I think.

 

Nick

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...