Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

add new fields to create_account


usmanaa

Recommended Posts

Posted

Hi

 

i want to add some more fields to my create_account_process. I can;t seem to find the insert command which inserts the records into the table

 

help much appricated

Thanks

Posted

There are multi. files to change , depending on your needs.

Application top, english, create account ,

what do you want to do?

Posted

i just want to find the sql "insert" command which allows me to insert into the database...

 

I have created a field called "Address 2" in account_details, now i need to add to database.

Posted

Look for the *_process.php files (i.e. account_edit_process.php and create_account_process.php).

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

I've finally added a new field "address2" to create_account_process.

 

How can I add "Address2" to the checkout_shipping and checkout_payment pages, so it shows the full address...

 

in the code this is used to display the address

 

<?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?>

 

which links to this

 

 function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "n") {

   $address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_address2 as address2, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customers_id . "' and address_book_id = '" . $address_id . "'");

   $address = tep_db_fetch_array($address_query);

   $format_id = tep_get_address_format_id($address['country_id']);

   return tep_address_format($format_id, $address, $html, $boln, $eoln);

 }



////

// Return a formatted address

// TABLES: address_book, address_format

 function tep_address_summary($customers_id, $address_id) {

   $customers_id = tep_db_prepare_input($customers_id);

   $address_id = tep_db_prepare_input($address_id);



   $address_query = tep_db_query("select ab.entry_address2, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_state, ab.entry_country_id, ab.entry_zone_id, c.countries_name, c.address_format_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_COUNTRIES . " c where ab.address_book_id = '" . tep_db_input($address_id) . "' and ab.customers_id = '" . tep_db_input($customers_id) . "' and ab.entry_country_id = c.countries_id");

   $address = tep_db_fetch_array($address_query);



   $street_address = $address['entry_street_address'];

   $address2 = $address['entry_address2'];

   $suburb = $address['entry_suburb'];

   $postcode = $address['entry_postcode'];

   $city = $address['entry_city'];

   $state = tep_get_zone_code($address['entry_country_id'], $address['entry_zone_id'], $address['entry_state']);

   $country = $address['countries_name'];



   $address_format_query = tep_db_query("select address_summary from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . $address['address_format_id'] . "'");

   $address_format = tep_db_fetch_array($address_format_query);



//    eval("$address = "{$address_format['address_summary']}";");

   $address_summary = $address_format['address_summary'];

   eval("$address = "$address_summary";");



   return $address;

 }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...