Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customers extra fields


kit

Recommended Posts

Well... I'm slightly closer to adding the extra fields into the Customer Orders area. I think once we figure out how to do this... we can add it to other areas as well...

 

Here's what I have done:

 

added the following code to the orders.php file:

 

<td class="main"></td><?php echo tep_get_extra_fields($cInfo->customers_id,$languages_id)?>

 

I created a new table after the code for payment method and credit cards...it begins on line 206 and looks like this

 

<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

 

<tr>

<td colspan="3"><?php echo tep_draw_separator(); ?></td>

</tr>

<tr>

<td class="main" valign="top"><b>Order Details</b></td>

<td class="main"></td><?php echo tep_get_extra_fields($cInfo->customers_id,$languages_id)?>

</tr>

</table></td>

 

This produces all of the extra fields... but sadly, without the text input from the customer.

 

I thought maybe this could help someone more experienced than myself figure out a way to make this happen....

 

...Aaron

Link to comment
Share on other sites

  • 2 weeks later...

Has anyone figured out how to add the extra field onto the invoice? Thank you, for the Great Contrib.

If noone has done it yet, anyone have a starting point?

 

Todd

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I'm getting the same error and I found no solution:

 

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

select count(*) as total from TABLE_EXTRA_FIELDS ce, TABLE_EXTRA_FIELDS_INFO cei where cei.fields_id=ce.fields_id and cei.languages_id =1

[TEP STOP]

 

Does anyone know the solution to this?

Sorry for my bad english language!

Link to comment
Share on other sites

New "little" problem:

 

The new fields I add from Admin don't show up when I receive an order (in Show Order Details), not even if I enter Customer Details.

 

What should I do?

Sorry for my bad english language!

Link to comment
Share on other sites

In your admin go to Administrator - file access and add the php modules that you installed. They are sorted by directory..

 

 

Hi All,

Very nice contribution Kit! Thanks a lot.

 

I installed the extra fields contribution over an Admin contribution. when in the admin screen and i click on the extra fields manager link I get this error

"Access Denied

 

No Right Permission Access

Please contact your Web Administrator to request

more access or if you found any problem. "

 

even though i have all the rights. I am not sure how to bypass this.

 

Any help would be appreciated.

 

Thanks in advance

-Tman

Link to comment
Share on other sites

  • 2 weeks later...

Curious to know.

 

I was looking to add a "How'd you find the site" field. and I wanted to do soemthing nifty like like have a lsit of viable options for the user. IS that possible? btw I successfully installed the mod, your instructions were excellent. Great mod. trying to find other ways to sue the mod... but drawing blanks... maybe i need more coffee. any light that youc an shed on the topic would be rgeatly appreciated.

 

~J

We must be the change we wish to see in the world.

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

p.s. BACKUP!

Link to comment
Share on other sites

hello, it is a nice contrib. thanks but it only creat field each other: i mean..

when i creat a field it creat like that:

 

name

full name

 

And i want one after the adress:

company owner: _____

 

 

and one the after newsletter

newsletter: X

extra field: _____

 

How can i do that? thanks!

Link to comment
Share on other sites

Very easy installation. Thanks for writing this.

 

Has anyone in this forum modified this contribution to include these handy features?

 

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

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

 

Thanks. I can definitely come up with workarounds or even code this myself, but I'd rather not reinvent the wheel.

 

Bruce

Link to comment
Share on other sites

  • 4 weeks later...

Dear Kit.

Wanted to let you know that you did a great job with this contribution. One thing though. If there is any link in admin to use this contribution i can't see it. Maybe my admin is kinda messed up and I do beliebe that it's so cause it only works on specific browsers :blush: So if the contrib does contain a link in admin, please specify for the novices that might go through the same trouble, that they can access the contrib via navbar.

ex: http://mysite/admin/extra_fields.php.

Took a while till i found that out :D

Link to comment
Share on other sites

I have followed all the steps and there no errors when I run the admin panel.

 

 

 

But I do not see any way to use this Contibution exter fields. I go to the customer area

 

and there is no controls for the addon / where are they located?

 

 

 

Lost Again

 

Thanks

Link to comment
Share on other sites

New "little" problem:

 

The new fields I add from Admin don't show up when I receive an order (in Show Order Details), not even if I enter Customer Details.

 

What should I do?

 

Has anyone found a fix for this problem?

Sorry for my bad english language!

Link to comment
Share on other sites

I have followed all the steps and there no errors when I run the admin panel.

But I do not see any way to use this Contibution exter fields. I go to the customer area

and there is no controls for the addon / where are they located?

 

OK I located the Page / not in the menu http://mysite/admin/extra_fields.php. / need to fix that.

 

Now that I have located the right page. Why does all the headers look like this

 

 

 

HEADING_TITLE

 

TABLE_HEADING_FIELDSTABLE_HEADING_STATUSTABLE_HEADING_ACTION]

Link to comment
Share on other sites

  • 2 weeks later...

So, my problem is:

 

When a customer enters his/her's social security number it doesn't show in Admin/Customers nor in invoice. If I enter that customer's account and modify myself that social security number it's not remembered by the Admin, it turns blank i f I re-enter customer's account after the operation.

 

Any one know what's the problem??

Sorry for my bad english language!

Link to comment
Share on other sites

  • 2 weeks later...

Hello all.

 

Quick question about this contribution.

 

Does this allow to manipulate only the new fields? Or will I be able to add/edit/delte and set the required status on teh default osC Customer Fields?

 

Thank you,

 

Arkady

People dont change, people realize.

Link to comment
Share on other sites

To make it clear: your suposed to enter you site address /admin then /extra_fields.php and click enter.

 

 

The right link for using the contribution is http://mysite/admin/extra_fields.php

IMPORTANT: Replace mysite with the name of your site (for ex: www.george.com, www.hereiam.ro, nowww.eu)

ITS NOT extra fields.php its extra_fields.php !!remember to put the underscore

Edited by Vantalk
Link to comment
Share on other sites

I seem to found out a solution (at least for desperate guys :blush: ) to make extra_fields contrib show in e-mail confirmation and almost anywhere you want it.

 

Here is what i did:

 

1. In file english.php add:

 

define('SHOW_EXTRA_FIELDS', tep_get_extra_fields($customer_id, $languages_id));

 

Do this in any other language file.

 

2. In checkout_process.php find the line:

 

$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";

}

 

3. After add (you can add it anywhere else in the file between the two comments: // lets start with the email confirmation; // send emails to other people):

 

$email_order.="\n". SHOW_EXTRA_FIELDS . "\n";

 

Downsize of this: It makes kinda of a big space before it shows the fields, has a small i dono what that is and can be edited as normal fields.. at least you can't save changes.

 

You can add the constant SHOW_EXTRA_FIELDS in almost anywhere where you want to make the completed fields show up.

Link to comment
Share on other sites

What can i say.. it kinda looks ugly but it shows up the completed fields.. So if there is anyone with more knoledge to tell me how can i make the confirmation e-mail show the extra_fields only to me and not the customer?

Also i believe the big space and the small thingy at the finish is caused by the fact that the fields where put in a box (as in create account).. How can i get rid of the borders of that box in create account?

 

Any help would be hugely apreciated. :blush:

Link to comment
Share on other sites

Ok. So i diged some more.. to make everything look better in create account and in the email confirmation you have to modify general.php found in /includes/functions/general.php.

I simply removed the table tags.. So this is how it looks now for me:

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 .= '<td>
								 <tr class="infoBoxContents"><td>';
		 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 .='<tr>
									<td class="main" valign="top">' . $extra_fields['fields_name'] . ': </td>
									<td class="main" valign="top">' . (($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) ? '<span class="inputRequirement">*</span>': '') .'</td>
									</tr>';
		 }
		 $extra_fields_string .= '</td></tr></td></tr>';
		 $extra_fields_string .= '<tr><td></td></tr>';
	  }
	  return $extra_fields_string;
 }

 

 

Now it looks better in you confirmation email and even in the customers email. Maybe i should call this my little contrib? :D

Edited by Vantalk
Link to comment
Share on other sites

I just upgraded to OSC 2.2.4 and it blew all my extra fields mods. Argh.

 

I had to go in and create a new test account and I found Fatal error: Call to undefined function: tep_get_extra_fields() in /home/u3/mydomain/html/osc/create_account.php on line 495

 

Anyone else have this problem? Can I upload the older local files, or would that be a bad idea?

Edited by delirium
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...