z0rr0 Posted September 12, 2007 Share Posted September 12, 2007 Cool contrib :thumbsup: The only problem is that I can't see my extra fields in checkout_shipping_address.php and checkout_payment_address.php.I have many customers who have different addresses for payment and shipping...It will be to nice to have some kind of option to choose the address in this pages so the customers don't have to imput every time all the fields :-" Quote Cumparaturi4all Link to comment Share on other sites More sharing options...
z0rr0 Posted September 12, 2007 Share Posted September 12, 2007 Cool contrib :thumbsup: The only problem is that I can't see my extra fields in checkout_shipping_address.php and checkout_payment_address.php.I have many customers who have different addresses for payment and shipping...It will be to nice to have some kind of option to choose the address in this pages so the customers don't have to imput every time all the fields :-"   found another interesting contrib for a quick address changing on checkout Easy Address Change During Checkout   now working on adding extra fields to checkout_shipping_address.php and checkout_payment_address.php :'( Quote Cumparaturi4all Link to comment Share on other sites More sharing options...
81f82eae Posted September 13, 2007 Share Posted September 13, 2007 "PHP is not forgiving. You need to follow, step by step. " Â Don't I know it. Â Cheers, guys! I'll give it another crack. Quote Link to comment Share on other sites More sharing options...
a_khan69 Posted September 21, 2007 Share Posted September 21, 2007 First, great contribution. Thanks :) Â I also added this contribution http://www.oscommerce.com/community/contributions,3737 (which works great, kudos) Â My question is: Â 1. I need for the extra pages to show up on checkout_shipping.php (where customer is able to edit just as in acount_edit.php) Â 2. After i click continue or proceed to checkout_payment.php, it should update the extra fields accordingly in the db table "customers_to_extra_fields" Â So basically the idea is for the customer to be able to update the extra fields in checkout_shipping.php without having to go back to account_edit.php and of course, the most current edits to show up in the confirmation email. Â Any help is greatly appreciated. Â Thank you Quote Link to comment Share on other sites More sharing options...
a_khan69 Posted October 8, 2007 Share Posted October 8, 2007 First, great contribution. Thanks :) I also added this contribution http://www.oscommerce.com/community/contributions,3737 (which works great, kudos)  My question is:  1. I need for the extra pages to show up on checkout_shipping.php (where customer is able to edit just as in acount_edit.php)  2. After i click continue or proceed to checkout_payment.php, it should update the extra fields accordingly in the db table "customers_to_extra_fields"  So basically the idea is for the customer to be able to update the extra fields in checkout_shipping.php without having to go back to account_edit.php and of course, the most current edits to show up in the confirmation email.  Any help is greatly appreciated.  Thank you  I figured out a way to get this to work.  Thanks. Quote Link to comment Share on other sites More sharing options...
magicmycote Posted October 8, 2007 Share Posted October 8, 2007 I figured out a way to get this to work. Â Thanks. Â will you outline how you got this to work? Â and how can I get these extra fields to show up on the order edit or invoice page? Quote Link to comment Share on other sites More sharing options...
magicmycote Posted October 9, 2007 Share Posted October 9, 2007 I'm glad insomniac2 jumped on this ... I'll have to see about the email part as there is already an update for emailing (that works for me, at least). Anyways ... here's the first draft of some code to get the invoice to print the extra fields. As insomniac2 mentioned, we have enough code in this contribution to help generate the extra fields almost anywhere, although I believe it was only missing the invoice integration. Everything else (add/edit forms, etc) should be easier and I'll get working on Order Editor. Â Below I tried to mimic the structure used within osC without changing anything, per se. I wanted to simply get an extra piece of information into queries that are already being run. Then use that extra "id" info for tying together orders/customers/extra_fields, etc. FILE: admin/includes/classes/order.php LINE ~13 NOTE- We need to add a variable to hold our extra fields info. FIND: class order { var $info, $totals, $products, $customer, $delivery, $content_type; function order($order_id = '') { $this->info = array(); REPLACE: class order { var $info, $extra_fields, $totals, $products, $customer, $delivery; function order($order_id) { $this->info = array(); $this->extra_fields = array(); FILE: admin/includes/classes/order.php LINE ~28 NOTE - The only change for the following find/replace is the addition of "customers_id" to the order_query. FIND: $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id. "'"); Â REPLACE: $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); FILE: admin/includes/classes/order.php LINE ~48 Only added 'cust_id' => $order['customers_id'], to the "$this->customer = array" -- don't forget the comma. $this->customer = array('cust_id' => $order['customers_id'], 'name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']); FILE: admin/invoice.php NOTE - This output is its own table that can be placed above the "Comments" on the invoice.php. Seeing how there are a number of different invoice layouts available, then I suggest plugging this in above the comments section and below the products. Otherwise just take your time and work with the formatting. <!-- PRINT EXTRA FIELDS CODE STARTS HERE //--> <?php $orders_extrafields_query = tep_db_query("SELECT DISTINCT o.customers_id, cte.value, efi.fields_name, o.customers_name FROM " .TABLE_EXTRA_FIELDS_INFO. " efi INNER JOIN " .TABLE_CUSTOMERS_TO_EXTRA_FIELDS. " cte ON (efi.fields_id = cte.fields_id) INNER JOIN " .TABLE_ORDERS. " o ON (cte.customers_id = o.customers_id) WHERE (efi.languages_id = '".$languages_id."') AND (o.customers_id ='". tep_db_input($order->customer['cust_id']) ."') ORDER BY cte.fields_id ASC"); if (tep_db_num_rows($orders_extrafields_query)) { $has_extrafields = false; echo ' <tr>'; echo ' <td width="95%">' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>'; echo ' </tr>'; echo ' <table width="95%" width="100%" border="0" cellpadding="0" cellspacing="0" class="main">'; echo ' <tr>'; echo ' <td><strong>' . TABLE_HEADING_EXTRAFIELDS . ':</strong><br><br></td>'; echo ' </tr>'; while ($orders_extrafields = tep_db_fetch_array($orders_extrafields_query)) { if (tep_not_null($orders_extrafields['value'])) { $has_extrafields = true;// Not Null = Has Extra Fields if (tep_not_null($orders_extrafields['value'])) { $exInfo = new objectInfo($orders_extrafields); echo '<tr>'; echo ' <td width="95%">'; echo ' <strong>' . nl2br(tep_db_output($orders_extrafields['fields_name'])) .':</strong><br /><span class="smallText">' . nl2br(tep_db_output($orders_extrafields['value'])) . '</span><br /><br />'; echo ' </td>'; echo '</tr>'; } } } if ($has_extrafields == false) { /*most of this stuff is row-to-row ending the section (with a FINAL row to end the table) */ echo ' <tr>'; echo ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>'; echo ' </tr>'; } echo ' <tr>'; echo ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>'; echo ' </tr>'; echo ' </table>'; } ?> <!-- PRINT EXTRA FIELDS CODE ENDS HERE //--> Â How can I get this extra field(s) to show on the order edit page? The stock OSC order editor? Was this ever completed? THanks! Quote Link to comment Share on other sites More sharing options...
a_khan69 Posted October 14, 2007 Share Posted October 14, 2007 Place this code where you want the extra fields to show up    <!-- START Customers Extra Field -->  <?php echo tep_get_extra_fields($customer_id, $languages_id)?>  <!-- END Customers Extra Field -->      Towards the top of the page, find the code that processess the action initiated by the (in my case continue button on checkout_shipping.php) "continue button".  Place the code below such that when the "continue button" is initiated, your customer extra field code is also run.   In my case, i placed the customer extra fields code after:  // process the selected shipping method if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) { if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); }    //START Customers Extra Field   tep_db_query("delete from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . $customer_id); $extra_fields_query = tep_db_query("select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 "); while($extra_fields = tep_db_fetch_array($extra_fields_query)){ $sql_data_array = array('customers_id' => $customer_id, 'fields_id' => $extra_fields['fields_id'], 'value' => $HTTP_POST_VARS['fields_' . $extra_fields['fields_id']]); tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array); }  //END Customers Extra Field Quote Link to comment Share on other sites More sharing options...
strobe73 Posted October 15, 2007 Share Posted October 15, 2007 I have this contribution installed as well http://www.oscommerce.com/community/contri...required+fields  the edit for form_check.js.php in the instuctions don't match and thus the form goes through with or without the required fields entered. Quote Link to comment Share on other sites More sharing options...
riwi Posted October 16, 2007 Share Posted October 16, 2007 Customers Extra Fields EXTENDED by kit 15 Oct 2007  This addon created on basis of Customers Extra Fields v1.2a Rollup.  But it allow to add next types of extra fields:  1) Text (Standart) 2) Textarea (Standart) 3) Radiobuttons list 4) Multicheck list 5) Drop down menu  Kit, I hope you still read this topic. I have tried to install your contri, but what changed ??? I can't tell ...  Do you have update-instructions for me ?? Quote Link to comment Share on other sites More sharing options...
z0rr0 Posted October 16, 2007 Share Posted October 16, 2007 Place this code where you want the extra fields to show up   <!-- START Customers Extra Field -->  <?php echo tep_get_extra_fields($customer_id, $languages_id)?>  <!-- END Customers Extra Field -->      Towards the top of the page, find the code that processess the action initiated by the (in my case continue button on checkout_shipping.php) "continue button".  Place the code below such that when the "continue button" is initiated, your customer extra field code is also run.   In my case, i placed the customer extra fields code after:  // process the selected shipping method if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) { if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); }    //START Customers Extra Field   tep_db_query("delete from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . $customer_id); $extra_fields_query = tep_db_query("select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 "); while($extra_fields = tep_db_fetch_array($extra_fields_query)){ $sql_data_array = array('customers_id' => $customer_id, 'fields_id' => $extra_fields['fields_id'], 'value' => $HTTP_POST_VARS['fields_' . $extra_fields['fields_id']]); tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array); }  //END Customers Extra Field  Cool stuff :thumbsup: But how do I add this to checkout_payment_address.php ? :blush: I am new at this php stuff and the above code doesn't apply to checkout_payment_address.php. Thanks Quote Cumparaturi4all Link to comment Share on other sites More sharing options...
a_khan69 Posted October 17, 2007 Share Posted October 17, 2007 (edited) Cool stuff :thumbsup: But how do I add this to checkout_payment_address.php ? :blush: I am new at this php stuff and the above code doesn't apply to checkout_payment_address.php. Thanks  BACK UP YOUR FILE BEFORE YOU DO THIS IN CASE YOU HAVE TO REVERT BACK   1. LOOK FOR:  // process a new billing address if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) { $process = true;  2. AFTER THIS, IN A NEW LINE, ADD:  //START Customers Extra Field   tep_db_query("delete from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . $customer_id); $extra_fields_query = tep_db_query("select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 "); while($extra_fields = tep_db_fetch_array($extra_fields_query)){ $sql_data_array = array('customers_id' => $customer_id, 'fields_id' => $extra_fields['fields_id'], 'value' => $HTTP_POST_VARS['fields_' . $extra_fields['fields_id']]); tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array); }  //END Customers Extra Field   3. AROUND LINE 407, LOOK FOR:  if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) {  4. AFTER THIS, IN A NEW LINE, ADD:  <tr> <td> <!-- START Customers Extra Field -->  <?php echo tep_get_extra_fields($customer_id, $languages_id)?>  <!-- END Customers Extra Field --> </td> </tr> Edited October 17, 2007 by a_khan69 Quote Link to comment Share on other sites More sharing options...
dailce Posted October 18, 2007 Share Posted October 18, 2007 In Admin, when you check an order details you can view stuff like customer information phone/name/etc... These are fields that the customer can fill in when creating an account. Â How can I display what a customer entered for the extra fields in the orders detail page (orders.php)???? Â For instance, when I create my extra field say ("how did you hear about us") I want to display what the customer entered on the order page. Â Any ideas? Quote Link to comment Share on other sites More sharing options...
stefan_p Posted November 8, 2007 Share Posted November 8, 2007 I get error message when updating database in PhpMyadmin: Â Â CREATE TABLE customers_to_extra_fields( customers_id int( 11 ) NOT NULL default '0', fields_id int( 11 ) NOT NULL default '0', `value` text ) ENGINE = MYISAM DEFAULT CHARSET = utf8; Â MySQL message: Â #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=utf8' at line 5 Â Can someone help me?! Thanks Quote Link to comment Share on other sites More sharing options...
western Posted November 12, 2007 Share Posted November 12, 2007 (edited) Today I was adding to Customer Extra Field last contr named Customers Extra Fields EXTENDED Â I find a problem: Â In admin/customers.php there isn't following code <tr> <td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td> </tr> Â so I don't know if i can add code :huh: <?echo tep_get_extra_fields($cInfo->customers_id,$languages_id)?> Â The same problem, in the same file admin/customers.php in searching if ($error == false) { Â I don't find it !!! Â Doing this contribution by myself is rather impossible for me, I'm still new in programming php. :blush: it will take month or years to me! Â Can you help me? I will be grateful to you. :D Edited November 12, 2007 by western Quote Link to comment Share on other sites More sharing options...
western Posted November 12, 2007 Share Posted November 12, 2007 (edited) SORRY! :blush: Â With my old dreamWeaver 2004 I opened a different file with the same name. Please pardon me, Â IT'S ALL OK! Â Thank you for your contrib! You're fantastic!!!! Â I'll soon made my contrib and put them here. When I'll know more about Php. Now your help was really important to me. Â Thank you!!! :D :thumbsup: Edited November 12, 2007 by western Quote Link to comment Share on other sites More sharing options...
evp Posted November 14, 2007 Share Posted November 14, 2007 Hi and thanks for this contribution. Just installed latest extra fields extended and would like to report few minor issues that perhaps could be fixed in the next release:  1. mysql stric mode --- "1366 - Incorrect integer value: 'on' for column" 2. administration -- 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 global languages_id in not read ... fixed it for now by adding to extra_field_query in admin/general.php TABLE_LANGUAGES 3. when a customer is deleted the info regarding his extra fields in customer_to_extra_fields table is not deleted 4. a field must be chosen (phisically checked in) while creating it. Default value does not seem to work very well  Thanks again Quote /e Link to comment Share on other sites More sharing options...
evp Posted November 14, 2007 Share Posted November 14, 2007 multi checkboxes cause Warning: in_array() in the following function (general.php) Â $extra_fields_string .= tep_draw_selection_field('fields_' . $extra_fields['fields_id'] . '_' . ($cnt++), 'checkbox', $item, ((in_array($item, $value_list))?(true):(false))).$item. (($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': '').'<br>'; Â fix: replace the string with the one in catalog/functions/general.php Quote /e Link to comment Share on other sites More sharing options...
Markz_z Posted January 3, 2008 Share Posted January 3, 2008 i am look forward if it is possible to add picture in this contrib too.... for the field that i wanna add needs picture to explain what needs to be filled .... for example ....... :-" what is the smiley doing <whistling> Quote Link to comment Share on other sites More sharing options...
railroadguy Posted January 3, 2008 Share Posted January 3, 2008 This script works great. One questions that I did not see, how would add this information on to the account_history_info.php? I tried a few things but I think I need a SQL string to bring in the information. Â Dan Quote Link to comment Share on other sites More sharing options...
Guest Posted January 8, 2008 Share Posted January 8, 2008 Hi  Great Contribution - should save a lot of time. Only problem is I'm using it alongside pay without account, in addition I only have pay without account active. When the customer buys a customer account is never actually created, I therfore need to post the extra field info into admin/orders.php somehow.  My knowledge of php is limited at best is there anyone out there would know how to do this?  Cheers Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2008 Share Posted January 11, 2008 I figured out a way to get this to work. Â Thanks. Â Hi, Â Can you share how you got this to work? You can PM me, but it would also be good for others to see what you did. Â Thanks for your help. Â Erick Quote Link to comment Share on other sites More sharing options...
llazy Posted January 20, 2008 Share Posted January 20, 2008 Hi, find error: Â Parse error: syntax error, unexpected '<' in /home/mycoo1/public_html/test/generalmerchandise/admin/includes/filenames.php on line 51 Â Can anyone help me to fix it up? Quote Link to comment Share on other sites More sharing options...
llazy Posted January 21, 2008 Share Posted January 21, 2008 problem fixed. but got new error: Â Â Warning: Cannot modify header information - headers already sent by (output started at /home/mycoo1/public_html/test/generalmerchandise/admin/includes/languages/english.php:309) in /home/mycoo1/public_html/test/generalmerchandise/admin/includes/functions/general.php on line 18 Quote Link to comment Share on other sites More sharing options...
redfoxmedia Posted January 23, 2008 Share Posted January 23, 2008 Anyone know how to combine it with purchase without account? Â Â I am also having the same problem, has anyone worked out a solution for this yet? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.