Jump to content
Sign in to follow this  
kit

Customers extra fields

Recommended Posts

I've just installed this contribution and now I've got this on my admin page:

 

Fatal error: Cannot redeclare tep_get_extra_fields() (previously declared in /var/www/www.mysite.dk/www/catalog/admin/includes/functions/general.php:345) in /var/www/www.mysite.dk/www/catalog/admin/includes/functions/general.php on line 1315

 

can anyone help me with this?

 

Regards

 

Michael

Share this post


Link to post
Share on other sites

Is there anyway we can add dropdowns or radio buttons easily??

 

does anybody have any idea how??????

 

 

This would really help a lot of ppl..

 

 

 

 

Regards

Jack


Converge

Share this post


Link to post
Share on other sites
Hi,

Could someone pllease help me to insert this new fields in invoice ?

 

Thank's

 

 

I also would like to know if these extra fields will show up on the invoice/packing slip/preview pages. I need things like year/make/model on each order. Can anybody shed some light??

 

Thanks in advance

 

Jeff

Share this post


Link to post
Share on other sites

Hi all!

I have a problem after the installation, I always get this error just above my admin section:

 

function tep_get_extra_fields($customer_id,$languages_id){ $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 from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id); $extra_fields_string =''; if(tep_db_num_rows($extra_fields_query)>0){ $extra_fields_string .= '' . CATEGORY_EXTRA_FIELDS .''; $extra_fields_string .= ''; while($extra_fields = tep_db_fetch_array($extra_fields_query)){ $value=''; if(isset($customer_id)){ $value_query = tep_db_query("select value from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . $customer_id . " and fields_id=" . $extra_fields['fields_id']); $value_info = tep_db_fetch_array($value_query); $value = $value_info['value']; } $extra_fields_string .=' ' . $extra_fields['fields_name'] . ': ' . (($extra_fields['fields_input_type']==0) ? tep_draw_input_field('fields_' . $extra_fields['fields_id'],$value) : tep_draw_textarea_field('fields_' . $extra_fields['fields_id'], 'soft', 50, 6,$value,'style="width:400px;"')) . ' ' . (($extra_fields['fields_required_status']==1) ? '*': '') .'

'; } $extra_fields_string .= '

'; $extra_fields_string .= '' . tep_draw_separator('pixel_trans.gif', '100%', '10') . ''; } return $extra_fields_string; } function tep_get_customers_extra_fields_name($fields_id, $language_id) { $fields_query = tep_db_query("select fields_name from " . TABLE_EXTRA_FIELDS_INFO . " where fields_id = '" . (int)$fields_id . "' and languages_id = '" . (int)$language_id . "'"); $fields = tep_db_fetch_array($fields_query); return $fields['fields_name']; }

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mounted-storage/home31c/sub004/sc27664-ZOKN/www/admin/includes/functions/general.php:1383) in /mounted-storage/home31c/sub004/sc27664-ZOKN/www/admin/includes/functions/sessions.php on line 67

 

 

What do I wrong please?

Share this post


Link to post
Share on other sites

Now I get this one:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mounted-storage/home31c/sub004/sc27664-ZOKN/www/admin/includes/functions/general.php:1418) in /mounted-storage/home31c/sub004/sc27664-ZOKN/www/admin/includes/functions/sessions.php on line 67

Share this post


Link to post
Share on other sites

Hi

this contrib is fantastic but on it i need other features..

there is a example

 

i create 2 new fields like djrino and djrino1

on the create_account.php i see the 2 new fields and if i set to required i see a * ont eh 2 fields

now on the field djrino i need to put a description like (do you put this on this field)

but if i make this on one field the change are made to all the other..

 

there is any way to make this possible?

 

Many tnx

Share this post


Link to post
Share on other sites

hiya, Great contrib, I hope, I think!

 

Ran into a couple of snags though. There are a few lines I was unable to find on a couple of pages. So I did not add the additional nessesary code.

 

Could not find

 

#13 In catalog/create_acount.php

	if ($error == false) {

or

   $customer_id = tep_db_insert_id();

 

#15. In catalog/account_edit.php

	if ($error == false) {

 

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");

 

With out these code markers I do not know where to add the additional code for the contribution.

 

 

For the most part, the contribution seems to work ( almost ) i do have the extra fields tool in the admin section where I am able to add extra fields. As a costomer registering on the site, it does show the extra fields questions. However, the extra fields section does now show up when i view the customers information in the admin section.

 

I can only assume it is because I am missing the additional code.

 

what should I do to complete the install ?

 

THanx

Nancy :D

Share this post


Link to post
Share on other sites
hiya, Great contrib, I hope, I think!

 

Ran into a couple of snags though. There are a few lines I was unable to find on a couple of pages. So I did not add the additional nessesary code.

 

Could not find

 

#13 In catalog/create_acount.php

	if ($error == false) {

or

   $customer_id = tep_db_insert_id();

 

#15. In catalog/account_edit.php

	if ($error == false) {

 

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");

 

With out these code markers I do not know where to add the additional code for the contribution.

For the most part, the contribution seems to work ( almost ) i do have the extra fields tool in the admin section where I am able to add extra fields. As a costomer registering on the site, it does show the extra fields questions. However, the extra fields section does now show up when i view the customers information in the admin section.

 

I can only assume it is because I am missing the additional code.

 

what should I do to complete the install ?

 

 

THanx

Nancy :D

 

FIXED - Looked a little harder

Share this post


Link to post
Share on other sites

Quick Question,

 

the "Textarea field" is to long and throwing the page alignment out of wack.

Does anyone know where I can adjust the code to shorten the length a little bit?

 

Nancy :D

Share this post


Link to post
Share on other sites

Hi all

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 140

 

I admin area all works great ...

 

Please help me.

 

my email its duricv@bih.net.ba

Share this post


Link to post
Share on other sites
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 140

 

I admin area all works great ...

 

Please help me.

 

my email its duricv@bih.net.ba

 

Could you open the catalog/includes/form_check.js and cut and paste line 140 with a couple of lines above and below it please. it could be something really simple. like a missing .') but it would help if we could see the line.

 

Nancy :D

Share this post


Link to post
Share on other sites

Hi,

 

Instead of adding fields I want to minimize the data a customer needs to enter.

 

Does this "Customers extra fields" contri allow me to edit/delete these standard OSCommerce fields ?

 

I want to get rid of a few required fields, which cannot be set to false in admin/customer details, like street and town.

 

I would hugely appreciate it if someone can answer this.

 

Thanks,

RDuno

Share this post


Link to post
Share on other sites
Hi,

 

Does this "Customers extra fields" contri allow me to edit/delete these standard OSCommerce fields ?

 

Thanks,

RDuno

 

No, it doesn't.

Share this post


Link to post
Share on other sites
Well the install instructions have some small bugs. So go through and see if you included them, cause you shouldn't:

At: "5.In admin/includes/filename.php

Add the following lines:

define('FILENAME_EXTRA_FIELDS','extra_fields.php');<br><br>"

 

Reomve the: <br><br>

 

Same goes for step 7: "7. In admin/includes/languages/english/customers.php

Add line: define('CATEGORY_EXTRA_FIELDS','Extra fields');<br><br>"

Remove the: <br><br>

 

See if that works

 

 

I made sure of correcting these errors and still

 

when I creat a new account the screen is blank with no errors

Share this post


Link to post
Share on other sites

Hi Guys

 

really good of yuou to make this contrib. i'm looking forward to using it.

 

however a little problem that i hoped you could help with:

 

in admin i get:

 

Warning: call_user_func() expects first argument, 'tep_cfg_get_customer_group', to be a valid callback in J:\ralph web\breedershops\m2\admin\includes\functions\general.php on line 1234

Default Customer Group

 

Warning: call_user_func() expects first argument, 'tep_cfg_get_customer_group', to be a valid callback in J:\ralph web\breedershops\m2\admin\includes\functions\general.php on line 1234

 

help please

 

MrBeard

Share this post


Link to post
Share on other sites

1146 - Table 'me.TABLE_EXTRA_FIELDS' doesn't exist

 

select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type from TABLE_EXTRA_FIELDS ce, TABLE_EXTRA_FIELDS_INFO cei where ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =1

 

I installed per the directions and this is what I see when viewing a customer's record.

 

Thanks in advance.


WebSkipper

 

Everyday is a gift, not a given....

 

C Me @ Zen Cart

Share this post


Link to post
Share on other sites

Got it.

 

Missed #6 and #11. duh.

 

When does the Extra fields show up for the customer?

 

It doesn't and then there is an entity after the field.


WebSkipper

 

Everyday is a gift, not a given....

 

C Me @ Zen Cart

Share this post


Link to post
Share on other sites

i just read all the pages here !

i cant belive people still asking so mhelp when it s baisc to :

- install and double check so people wont say they missed some part

- when osc tells Table 'me.TABLE_EXTRA_FIELDS' doesn't exist , is it so hard to understand english , : it doesnt exist meaning you didnt do the table creation !!!!

- when it says cannot redeclare function already declared in general.php at ligne XXX, what more logical than to check why you got it declared 2 times ?

 

here is for the hard part , i get mad with so many post taht only require attention, logic, and to search a little bit in the basis of adding any contributions to the OSC stoc files

 

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

 

Here is the ideas that are coming from the many post and request here :

 

- being able to swich on or off a field in the admin so that you dont loose all the data for this extrafield if you dont want only to show for a while an extra field

- in admin, when creating a new field, a check that we dont enter an empty field name , or in the catalog part, if the field got no name to hide it in the language that was not named

- when creating a field , being able to create a list of value so that the field in catalog is shown as a droplist menu

- in catalog , show after required the number of minimum caracters that have to be entered

- Add Other field types besides INPUT TEXT and TEXTAREA. I'm especially interested in radio buttons.

- Comments after the fields (such as "enter to initials to approve automatic annual renewal").

- a way to define an order of showing defined in admin that will reflects in the customer create account and edit account

 

- Enable/disable extra fields to the invoice print out.

- Enable/disable showing extra fields in the admin/order details (original osC page)

- Enable/disable showing extra fields in the Order Editor contribution (3 places).

- Add admin-only extra fields that will print out in the update emails and invoices. ( to be clarified)

 

 

now i hope we can focus on that , also good coder dont hesitate to release new package to add features , even if it s buggy then people can test and releases corrected version, it s harder to find in the forum and know after time if the modifications are already made in the contribution page release


MS2

Share this post


Link to post
Share on other sites

Hi

 

I have just added this contribution, but when i go to the login page, it display blank, without error. Can anyone advice me.

 

Thanks.

Share this post


Link to post
Share on other sites

Thanks!

 

Great contribution. It took 2 hours for me to install, just require attention to all steps. Now it works fine!

Just a suggestions for future mod.

I found that the SQL set field length 'varchar' to 32 characters is not enough. Why not to make it

longer by default?

In the Instal_first.html it would be nice to have # of modified line in php file since it took a lot time to

find without.

 

Anyway it is great!

 

Sergei

Share this post


Link to post
Share on other sites

I updated this contribution with "Customers Extra Fields v1.2a Rollup" and I have a problem with "Required Status". This option can't be changed anymore. How can I solve this problem?

Edited by auro

Share this post


Link to post
Share on other sites
Hi

 

I have just added this contribution, but when i go to the login page, it display blank, without error. Can anyone advice me.

 

Thanks.

I'm also getting this error. All admin pages are completely blank. No error messages or anything. Looking up the source shows it's simply not reading anything. What can I do here? What needs to be changed? Considering the above was posted in July, is it safe to assume there's no more help available here? If so, is there a different contribution to allow extra fields to be added to the order form?

 

For the record, I followed this contribution: Customers Extra Fields v1.2a Rollup insomniac2 2 Dec 2006

 

Cheers!

Edited by skyline5k

Share this post


Link to post
Share on other sites

I installed this Contribution into a pretty heavily modded (Contributed) installation without any real issues except those noted here. The tagging <br><br> that caught my eye when moving the text and I thought, "those shouldn't be there" anyway.

 

The documentation is infact 'missing' thhe bit about what you may need to do to actually use the thing afterwards, like using File Access and adding the thing to the appropriate spot on the menu. But otherwise it works as advertised.

 

PHP is not forgiving. You need to follow, step by step.

 

Some of the ($error = false statements that you can't find may be because your installation has BTS installed and in that case you will actually need to look in the associated *content* file for your module, which is found in 'catalog/templates/xxx/content' and named similarly to the module name you were looking for.

 

This does work, my install is a MS2.2 derivative.

 

My advice, print out the installation file with a browser, not a text editor, place a comment next to each of your additions as you do them, // Extra Fields - Customers, at the beginning and end of your additions. In those parts of the code that are in between the </td><td> (table data) tags, you can include an inline comment in the <? php /* Extra Fields - Customer */ code here; ?> otherwise your // Extra Fields - Customers comment will show on your page output.

 

If you are just to add to the file, add at the end, always before the ?>

 

In a few cases you may need to make an adjustment , pay close attention to anything you are placing beyond, in some syntax, the last statement may end differently.

 

If you are instructed to place code segments before/after/etc, those are 'as is', and generally don't require changes to be made to surrounding code, but be very explicit where you place it as 'depth' in the code matters and how many } and { are before and after your placement depend on it working or not. If you have other contributions installed in like areas of the code you *MAY* need to do some reading over things if you have an 'unexpected <, ', T branch, { or whatever' error in your php.

 

Errors in PHP that are reported at say, line 75, may actually, and mostly are, the line before, if not several lines before. It's just that by the time it got to 75, it was 'all screwed up'.

 

Anyhow, print the docs out, use a pen, mark off each section as you do it. Period. In most of the reading here, I can see peoples problems are that where they skipped an entire chunk.

 

MAKE SURE YOUR SURROUNDING CODE is EXACT in function to what you see, an extra spaces here and there mostly don't matter.

 

A semicolon is the END of a statement, a period is a break to a new part. Missing semicolons and periods ca cause major headaches. If in doubt, look at surrounding code.

 

Use a color coding text editor, if your stuff is not the same color scheming as surrounding stuff, of the same nature, then you have improper syntax, spacing, etc, leading up to your added code. IE, all the <?php and ?> should be the same color, all the occurances of 'echo', should always be the same, etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×