This is a discussion on Company line of customer address within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; Company line of address (anywhere in store or order emails) cannot be moved... What is displayed: BK Transport (Company) Steven ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Company line of address (anywhere in store or order emails) cannot be moved... What is displayed: BK Transport (Company) Steven Jackson Jnr (Name) 1236 new street Elk Grove HI 94534 United States What is required: Steven Jackson Jnr (Name) BK Transport (Company) 1236 new street Elk Grove HI 94534 United States Adding $company to address_format @ sql database results in: BK Transport (Company) Steven Jackson Jnr (Name) BK Transport (Company) 1236 new street Elk Grove HI 94534 United States Help ! ? ! ? Many Thanks, Matt |
| Sponsored Links | ||
| ||
|
#2
| ||||
| ||||
| Yes it can be moved - don't add a feild in MYSQL. Find the code in the TEMPLATE directory and move it. Like in create_account.tpl.php Line 80.... <?php if (ACCOUNT_COMPANY == 'true') { .... <?php } ?> (line 109) MOVE to say line 44 would move the company name above the name... Now email are much the same - find the code and move it.... Not sure which email your thinking of but a search for the unique text (for just that email) in the language files will get you the variable - find the varible in the site you found the code you need to look at... Good Luck
__________________ JPF - osCMax Fourm Moderator Try out our osCMax at: Live Catalog Demo Limited access Admin: Live Admin Demo Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped! |
|
#3
| |||
| |||
| Thanks for your reply jpf but i think you have missed my point... I shall explain a bit more.. Pic 1 - Correct layout, how it should be displayed on all account/checkout pages and order emails... ![]() Pic 2 - Address layout puts the Company -ABOVE- the First Name, not below it as desired... ![]() Pic 3 - Order email puts the Company above the First Name again... ![]() I have searched and searched with UltraEdit and moved snippits of code everywhere but still no luck. Starting to go grey over this one as i have had no trouble customising any of my stores before. Thanks Matt |
|
#4
| ||||
| ||||
| Yes your right.... it call a fuction from general.php called: tep_address_format In that fuction generated the address format...modify the fuction... Code: function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
$address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
$address_format = tep_db_fetch_array($address_format_query);
$company = tep_output_string_protected($address['company']);
if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
$firstname = tep_output_string_protected($address['firstname']);
$lastname = tep_output_string_protected($address['lastname']);
} elseif (isset($address['name']) && tep_not_null($address['name'])) {
$firstname = tep_output_string_protected($address['name']);
$lastname = '';
} else {
$firstname = '';
$lastname = '';
}
$street = tep_output_string_protected($address['street_address']);
$suburb = tep_output_string_protected($address['suburb']);
Code: function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
$address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
$address_format = tep_db_fetch_array($address_format_query);
if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
$firstname = tep_output_string_protected($address['firstname']);
$lastname = tep_output_string_protected($address['lastname']);
} elseif (isset($address['name']) && tep_not_null($address['name'])) {
$firstname = tep_output_string_protected($address['name']);
$lastname = '';
} else {
$firstname = '';
$lastname = '';
}
$company = tep_output_string_protected($address['company']);
$street = tep_output_string_protected($address['street_address']);
$suburb = tep_output_string_protected($address['suburb']);
|
|
#5
| |||||
| |||||
| Thanks again jpf. I had previously edited "general.php" (using UltraEdit search) as per your recommendation before my last-gasp post here. Heres what i have now.... = Company ABOVE Name in 'general.php' results in: Quote:
= Company BELOW Name in 'general.php' results in: Quote:
= Commented ( // ) Company in 'general.php' results in: Quote:
= Adding '$company' to 'address_format' @ sql results in: Quote:
= Adding '$company' to 'address_format' @ sql and commented company line: Quote:
= The SQL line from 'address_format'. Code: $firstname $lastname$cr$streets$cr$city$cr$state $postcode$cr$country Code: // Return a formatted address
// TABLES: address_format
function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
$address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
$address_format = tep_db_fetch_array($address_format_query);
if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
$firstname = tep_output_string_protected($address['firstname']);
$lastname = tep_output_string_protected($address['lastname']);
} elseif (isset($address['name']) && tep_not_null($address['name'])) {
$firstname = tep_output_string_protected($address['name']);
$lastname = '';
} else {
$firstname = '';
$lastname = '';
}
$company = tep_output_string_protected($address['company']);
$street = tep_output_string_protected($address['street_address']);
$suburb = tep_output_string_protected($address['suburb']);
$city = tep_output_string_protected($address['city']);
$state = tep_output_string_protected($address['state']);
if (isset($address['country_id']) && tep_not_null($address['country_id'])) {
$country = tep_get_country_name($address['country_id']);
if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
$state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
}
} elseif (isset($address['country']) && tep_not_null($address['country'])) {
$country = tep_output_string_protected($address['country']);
} else {
$country = '';
}
$postcode = tep_output_string_protected($address['postcode']);
$zip = $postcode;
|
|
#6
| ||||
| ||||
| Okay delve a lot more and followed the code/fuctions..... Address is setup as in your ADMIN setting, ONLY 4 options - all NOT including company name...... Option 1: Add another format SQL: insert into address_format (address_format_id, address_format, address_summary) values ('5', '$firstname $lastname$cr$company$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country'); and remove/comment out in general.php line 527-529 // if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) { // $address = $company . $cr . $address; // } Works???? Option 2: Change just general.php line 527-529 to--- if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) { // $address = $company . $cr . $address; $address = $firstname . $lastname . $cr . $company . $cr . $streets . $cr . $city . ", " . $statecomma . $postcode . $cr . $country; } Which should work to produce... Steven Jackson BK Transport 1236 new street MyState, ST 12345 Farfarawaycountry What a pain in the a$$.... |
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| customer address required only | ogilirca | osCMax v2 Customization/Mods | 4 | 01-02-2007 11:24 AM |
| customer cannot edit address | battleaxe | osCommerce 2.2 Modification Help | 0 | 09-08-2005 04:27 AM |
| The ship to address is missing for the customer | shawnfunn | osCommerce 2.2 Installation Help | 0 | 02-08-2005 02:32 PM |
| Adding a second street address line? | uli | osCommerce 2.2 Modification Help | 1 | 08-12-2004 06:33 AM |
| Address book address line ordering | Anonymous | osCMax v1.7 Discussion | 2 | 11-29-2003 05:54 PM |