osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Company line of customer address

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 10-20-2005, 06:58 AM
New Member
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
afthrscomputers
Default Company line of customer address

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 10-20-2005, 10:15 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,808
Thanks: 5
Thanked 105 Times in 91 Posts
Rep Power: 12
jpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to all
Default RE: Company line of customer address

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 10-21-2005, 04:02 AM
New Member
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
afthrscomputers
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 10-21-2005, 09:06 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,808
Thanks: 5
Thanked 105 Times in 91 Posts
Rep Power: 12
jpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to all
Default

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']);
to
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']);
Good Luck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 10-21-2005, 10:09 AM
New Member
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
afthrscomputers
Default

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:
BK Transport
Steven Jackson
1236 new street
(3 lines, wrong)

=
Company BELOW Name in 'general.php' results in:
Quote:
BK Transport
Steven Jackson
1236 new street
(3 lines, no change)

=
Commented ( // ) Company in 'general.php' results in:
Quote:
Steven Jackson
1236 new street
(2 lines, nothing displayed)

=
Adding '$company' to 'address_format' @ sql results in:
Quote:
BK Transport
Steven Jackson
BK Transport
1236 new street
(4 lines, duplicate entry)

=
Adding '$company' to 'address_format' @ sql and commented company line:
Quote:
Steven Jackson

1236 new street
(3 lines, blank line NOT a typo.)

=
The SQL line from 'address_format'.
Code:
$firstname $lastname$cr$streets$cr$city$cr$state $postcode$cr$country
Lines 432->465 of 'general.php'.
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;
Thanks again, Matt
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 10-22-2005, 02:06 PM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,808
Thanks: 5
Thanked 105 Times in 91 Posts
Rep Power: 12
jpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to all
Default

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$$....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 12:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax