osCmax v2.5 User Manual
Results 1 to 8 of 8

address label order

This is a discussion on address label order within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi -- On the email notification that is sent to the "Send extra order emails to" email addresses. The address ...

      
  1. #1
    Active Member
    Join Date
    Aug 2004
    Posts
    117
    Rep Power
    0


    Default address label order

    Hi --

    On the email notification that is sent to the "Send extra order emails to" email addresses. The address if formatted in this way:

    Delivery Address
    ------------------------------------------------------

    Business Name
    FirstName LastName
    Address
    City, STATE Zip
    United States

    Is there a way to change it to:

    Delivery Address
    ------------------------------------------------------

    FirstName LastName
    Business Name
    Address
    City, STATE Zip
    United States


    The order of FirstName LastName & Business have been switched. I'm using oscmax 2.0. I've searched through the files but so far haven't found where this might be.

    checkout_process.php shows this:

    $email_order .= "n" . EMAIL_TEXT_DELIVERY_ADDRESS . "n" .
    EMAIL_SEPARATOR . "nn" .
    tep_address_label($customer_id, $sendto, 0, '', "n") . "n";


    Thanks,
    Barb

  2. #2
    Active Member
    Join Date
    Aug 2004
    Posts
    117
    Rep Power
    0


    Default Re: address label order

    I'm still looking for an answer to this, so if anyone has any ideas please let me know.

    Thanks,
    Barb

  3. #3
    osCMax Development Team
    Join Date
    Nov 2002
    Location
    Orlando
    Posts
    433
    Rep Power
    14


    Default Re: address label order

    Hi Barb,

    That's set in funchtions/general.php in the admin folder around line 500 as function tep_address_format. All this time I never noticed that batch print invoice and invoice.php have those 2 lines reversed although I think it's correct to have the company first.
    John

  4. #4
    Active Member
    Join Date
    Aug 2004
    Posts
    117
    Rep Power
    0


    Default Re: address label order

    Hi John,

    Thanks for the pointer. I looked at the function. Am I correct in thinking the only thing I need to do is move this line

    $company = tep_output_string_protected($address['company']);

    after the if statment instead of before it?


    OR is the key in this statement? ---

    if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
    $address = $company . $cr . $address;
    }

    Thanks for your help. I pasted the full function below for your reference.
    Barb



    ////
    // 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);

    $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']);
    $street2 = tep_output_string_protected($address['street_address2']);
    $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;

    if ($html) {
    // HTML Mode
    $HR = '<hr>';
    $hr = '<hr>';
    if ( ($boln == '') && ($eoln == "n") ) { // Values not specified, use rational defaults
    $CR = '<br>';
    $cr = '<br>';
    $eoln = $cr;
    } else { // Use values supplied
    $CR = $eoln . $boln;
    $cr = $CR;
    }
    } else {
    // Text Mode
    $CR = $eoln;
    $cr = $CR;
    $HR = '----------------------------------------';
    $hr = '----------------------------------------';
    }

    $statecomma = '';
    $streets = $street;
    if ($street2 != '') $streets = $streets . $cr . $street2;
    if ($suburb != '') $streets = $street . $cr . $suburb;
    if ($country == '') $country = tep_output_string_protected($address['country']);
    if ($state != '') $statecomma = $state . ', ';

    $fmt = $address_format['format'];
    eval("$address = "$fmt";");

    if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
    $address = $company . $cr . $address;
    }

    return $address;
    }

  5. #5
    osCMax Development Team
    Join Date
    Nov 2002
    Location
    Orlando
    Posts
    433
    Rep Power
    14


    Default Re: address label order

    Hi Barb,

    I haven't tried to manipulate this at all before but my thought is that you need to change the order that these are in so that the company line is after the names instead before. You might want to take a look at how Batch Print does it.

    PHP Code:
        $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 '';
        } 
    John

  6. #6
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: address label order

    Eveyone is thinking wrong.

    There are FIVE default address format in osCMax

    '1', '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country'
    '2', '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country'
    '3', '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country'
    '4', '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country'
    '5', '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country'


    If you want to add a format use SQL:

    insert into address_format (address_format, address_summary) values ('$firstname $lastname$cr$company$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country');


    THEN in the COUNTRY like Unitied States - change the address format to the address_id of the one added above - Possably "6"

    This should work fine.
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    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!

  7. #7
    osCMax Development Team
    Join Date
    Nov 2002
    Location
    Orlando
    Posts
    433
    Rep Power
    14


    Default Re: address label order

    Hi Jason,

    I thought about that but company is not stated in those examples but still prints out when entered. I thought the address format was to define the order for city, state, country, zip code and such. Originally OSC was ordered with city then post code as done in Europe and back then changes had to be hard coded in.

    Also, I thought if it's not changed in general.php won't the line calling for company still print or is that skipped?
    John

  8. #8
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: address label order

    If you do what I did - delete parts that say:

    if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
    $address = $company . $cr . $address;
    }

    as they are not needed....
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    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!

Similar Threads

  1. GOOGLE PHONEBOOK match tel and address on order
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 08-04-2008, 08:03 PM
  2. Print all shipping label WITHOUT open any order detail page?
    By kepin in forum osCmax v2 Customization/Mods
    Replies: 3
    Last Post: 07-05-2007, 08:48 PM
  3. Customer Info not in order (name, address, etc)
    By irr1449 in forum osCmax v2 Installation issues
    Replies: 2
    Last Post: 06-06-2007, 03:39 AM
  4. Address order
    By Draxeiro in forum osCmax v2 Customization/Mods
    Replies: 5
    Last Post: 11-22-2006, 09:07 AM
  5. Address Order
    By splendideyetorture in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 06-03-2005, 03:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •