Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2004
    Location
    Osaka Japan
    Posts
    163
    Plugin Contributions
    0

    Default Customers Name - Last Name, First Name

    In the script there are a few places where customers_name is used instead of first_name last_name. It seems if customers_name is used the name order becomes first last name.

    With Japanese the name order should be last first name.

    In the DB table address_format I can set the correct name order and it seems to work except in at least 2 cases where customers_name seems to be referenced. How do I change this?

    1) email\email_template_order_status.html

    <div>$EMAIL_CUSTOMERS_NAME sama</div>

    2) admin\orders.php, invoice.php, & packinglist.php
    I happen to be using Super Orders and the name order in orders.php, invoice.php, & packinglist.php is First Name Last Name

    NOTE
    If the customer is placing the order in English the name order should be first name last name.

  2. #2
    Join Date
    Aug 2004
    Location
    Osaka Japan
    Posts
    163
    Plugin Contributions
    0

    Default Re: Customers Name - Last Name, First Name

    Would changing includes/classes/order.php work?

    Line 595 'customers_name' => $this->customer['firstname'] . ' ' . $this->customer['lastname'],

    To

    Line 595 'customers_name' => $this->customer['lastname'] . ' ' . $this->customer['firstname'],

    That would change all languages, is there a language specific way to change name order?

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customers Name - Last Name, First Name

    You would have to find the language the order was placed in (not sure how without researching), but once you know that, you can make a test based on the language id, something like:
    PHP Code:
    //look up order language, get its id - before the statement that includes line 595
    //then test and set order
    if ($order_language_id == '3') {//use the id for Japanese
      
    $customers_name_order $this->customer['lastname'] . ' ' $this->customer['firstname'];
    } else {
      
    $customers_name_order $this->customer['firstname'] . ' ' $this->customer['lastname'];
    }

    //line 595
      
    'customers_name' => $customers_name_order
    This may need to be tweaked to fit the actual surrounding code. It might be possible to do the assignment right in line 595, depending on circumstances.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customers Name - Last Name, First Name

    If this e-mail is being processed in real time when the order is placed, the current language id will be the correct one. That makes it easy.
    PHP Code:
    if ($_SESSION['languages_id'] == '3') {//use the id for Japanese 
    Anything being processed at a later time will have to be handled differently; I don't know if the language in use when the order was placed is even saved for later reference.

  5. #5
    Join Date
    Aug 2004
    Location
    Osaka Japan
    Posts
    163
    Plugin Contributions
    0

    Default Re: Customers Name - Last Name, First Name

    Japanese language ID is 7, I will give it a shot and report back.

  6. #6
    Join Date
    Aug 2004
    Location
    Osaka Japan
    Posts
    163
    Plugin Contributions
    0

    Default Re: Customers Name - Last Name, First Name

    It became as follows;
    $sql_data_array = array('customers_id' => $_SESSION['customer_id'],
    //modification for Japanese name order
    if ($order_language_id == '7') {
    $customers_name_order = $this->customer['lastname'] . ' ' . $this->customer['firstname'];
    } else {
    $customers_name_order = $this->customer['firstname'] . ' ' . $this->customer['lastname'];
    }
    'customers_name' => $customers_name_order,
    //'customers_name' => $this->customer['firstname'] . ' ' . $this->customer['lastname'],
    'customers_company' => $this->customer['company'],

    Unfortunately it does not seem to change the name order.

  7. #7
    Join Date
    Aug 2004
    Location
    Osaka Japan
    Posts
    163
    Plugin Contributions
    0

    Default Re: Customers Name - Last Name, First Name

    Ouch, actually this coding caused a problem with the ordering process and results in an error. The customer cannot complete the order.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,870
    Plugin Contributions
    96

    Default Re: Customers Name - Last Name, First Name

    Look in your store's /logs directory. If you (or your customers) are receiving errors or whitescreens, then a myDEBUG*.log file will contain the details of the cause.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customers Name - Last Name, First Name

    The order assignment needs to happen *before* the statement that contains the name assignment, not inside the statement.
    PHP Code:
    //modification for Japanese name order
    if ($_SESSION['languages_id'] == '7') {
    $customers_name_order $this->customer['lastname'] . ' ' $this->customer['firstname'];
    } else {
    $customers_name_order $this->customer['firstname'] . ' ' $this->customer['lastname'];
    }

    $sql_data_array = array('customers_id' => $_SESSION['customer_id'],
    'customers_name' => $customers_name_order,
    'customers_company' => $this->customer['company'], 
    You also need to use the session variable $_SESSION['languages_id'].
    Last edited by gjh42; 14 May 2014 at 04:11 PM.

 

 

Similar Threads

  1. Modify the Write Reviews to Only Show First Name and then there Country Name
    By iDartsOnline in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Mar 2011, 03:16 AM
  2. Can I address BOTH first/last name in email?
    By Feznizzle in forum Customization from the Admin
    Replies: 8
    Last Post: 22 Oct 2010, 04:40 PM
  3. customer review first name last initial
    By shoesocks.com in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 23 Feb 2010, 06:24 AM
  4. switch the display of order of first name and last name on each address
    By weber in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Nov 2008, 07:34 PM
  5. Admin Customer Name, First/Last reversed
    By Peace Freak in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Sep 2006, 08:03 AM

Posting Permissions

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