Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Location
    Athlone, Ireland
    Posts
    176
    Plugin Contributions
    5

    Default Add to end of order number ie 1234 - 2010

    Hey guys,

    I was wondering if anyone knows if this is possible.

    I would like to add the year to the end of the order number so it reads 1234 - 2009.

    I would like it to show on the customers invoice and email confirmation but not really want it in the database cause when orders are exported to another program for processing the other program attathces the year/date to the end of the zencart generated order ID.

    even if its some added text that could need to be put somewhere to show 2010 in say the invoice file.

    If anyone have any ideas on how to do this that would be wonderful. Might even be handy for other people who are looking to do something similar.

    Cheers and Happy New Year

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

    Default Re: Add to end of order number ie 1234 - 2010

    For the confirmation e-mail, you can edit /includes/classes/order.php (caution - no override available - make a backup first) and add a bit of text, say in this block starting around line 900:
    PHP Code:
        // lets start with the email confirmation
        // make an array to store the html version
        
    $html_msg=array();

        
    //intro area
        
    $email_order EMAIL_TEXT_HEADER EMAIL_TEXT_FROM STORE_NAME "\n\n" .
        
    $this->customer['firstname'] . ' ' $this->customer['lastname'] . "\n\n" .
        
    EMAIL_THANKS_FOR_SHOPPING "\n" EMAIL_DETAILS_FOLLOW "\n" .
        
    EMAIL_SEPARATOR "\n" .
        
    EMAIL_TEXT_ORDER_NUMBER ' ' $zf_insert_id "\n" .
        
    EMAIL_TEXT_DATE_ORDERED ' ' strftime(DATE_FORMAT_LONG) . "\n" .
        
    EMAIL_TEXT_INVOICE_URL ' ' zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO'order_id=' $zf_insert_id'SSL'false) . "\n\n";
        
    $html_msg['EMAIL_TEXT_HEADER']     = EMAIL_TEXT_HEADER;
        
    $html_msg['EMAIL_TEXT_FROM']       = EMAIL_TEXT_FROM;
        
    $html_msg['INTRO_STORE_NAME']      = STORE_NAME;
        
    $html_msg['EMAIL_THANKS_FOR_SHOPPING'] = EMAIL_THANKS_FOR_SHOPPING;
        
    $html_msg['EMAIL_DETAILS_FOLLOW']  = EMAIL_DETAILS_FOLLOW;
        
    $html_msg['INTRO_ORDER_NUM_TITLE'] = EMAIL_TEXT_ORDER_NUMBER;
        
    $html_msg['INTRO_ORDER_NUMBER']    = $zf_insert_id;
        
    $html_msg['INTRO_DATE_TITLE']      = EMAIL_TEXT_DATE_ORDERED;
        
    $html_msg['INTRO_DATE_ORDERED']    = strftime(DATE_FORMAT_LONG);
        
    $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
        
    $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO'order_id=' $zf_insert_id'SSL'false); 
    Add the part in red:
    EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . '-2010' . "\n" .
    or for something easier/safer to maintain:
    EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . EMAIL_TEXT_ORDER_YEAR . "\n" .
    and then make a define file with a line
    define('EMAIL_TEXT_ORDER_YEAR','-2010');
    or you could add this define to the file where related constants are defined.

    Similarly with the HTML content:
    $html_msg['INTRO_ORDER_NUMBER'] = $zf_insert_id. EMAIL_TEXT_ORDER_YEAR;

    Other locations would be handled in a similar fashion.

  3. #3
    Join Date
    Apr 2008
    Location
    Athlone, Ireland
    Posts
    176
    Plugin Contributions
    5

    Default Re: Add to end of order number ie 1234 - 2010

    I dont know how I missed that. I should be able to use the same principle for showing it in customers order history too.


    Cheers Glen, your help is always appreciated.

    Happy New Year.


    Droppy

 

 

Similar Threads

  1. v139h Add customer name to end of title of admin order email
    By dgent in forum General Questions
    Replies: 1
    Last Post: 13 Nov 2014, 11:11 AM
  2. No 'Order Number' generated at end of ordering process.
    By surface8 in forum Basic Configuration
    Replies: 7
    Last Post: 6 Nov 2009, 12:48 AM
  3. Add Order Number Contact Page
    By ryanb4614 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 28 Aug 2009, 04:51 PM
  4. start from say order number #1215 rather than order number 1
    By vandiermen in forum Managing Customers and Orders
    Replies: 4
    Last Post: 18 Mar 2009, 02:07 PM
  5. Can I add a letter as part of an order number?
    By honeysclerose in forum Customization from the Admin
    Replies: 10
    Last Post: 3 May 2008, 01:12 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR