Ozmooseus Posted January 3, 2011 Share Posted January 3, 2011 Hi, I have successfully formatted and customised my PDF invoice created using; http://addons.oscommerce.com/info/3027 Quick question is how do I alter the date formating of the order date from mm/dd/yy to dd/mm/yy ? Formatting of tep_date_short is my issue I assume. //Draw Date of Order Text $temp = str_replace(' ', ' ', PRINT_INVOICE_DATE); $pdf->Text(50,113,$temp . tep_date_short($order->info['date_purchased'])); Thanks Heaps, Ryan. Quote Ryan, Australia Link to comment Share on other sites More sharing options...
germ Posted January 3, 2011 Share Posted January 3, 2011 In /catalog/includes/languages/english.php make the date format this: define('DATE_FORMAT', 'd/m/Y'); // this is used for date() Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Ozmooseus Posted January 4, 2011 Author Share Posted January 4, 2011 In /catalog/includes/languages/english.php make the date format this: define('DATE_FORMAT', 'd/m/Y'); // this is used for date() Thanks germ, However this is what I have; define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime() define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() define('DATE_FORMAT', 'd/m/Y'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); //// // Return date in raw format // $date should be in format mm/dd/yyyy // raw date is in format YYYYMMDD, or DDMMYYYY function tep_date_raw($date, $reverse = false) { if ($reverse) { return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4); } else { return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2); } } Thanks, Ryan. Quote Ryan, Australia Link to comment Share on other sites More sharing options...
germ Posted January 4, 2011 Share Posted January 4, 2011 (edited) Change this: $pdf->Text(50,113,$temp . tep_date_short($order->info['date_purchased'])); To this: $pdf->Text(50,113,$temp . substr(tep_date_short($order->info['date_purchased']), 3, 2) . '/' . substr(tep_date_short($order->info['date_purchased']), 0, 2) . '/' . substr(tep_date_short($order->info['date_purchased']), 6, 4) ); Edited January 4, 2011 by germ Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Ozmooseus Posted January 4, 2011 Author Share Posted January 4, 2011 Change this: $pdf->Text(50,113,$temp . tep_date_short($order->info['date_purchased'])); To this: $pdf->Text(50,113,$temp . substr(tep_date_short($order->info['date_purchased']), 3, 2) . '/' . substr(tep_date_short($order->info['date_purchased']), 0, 2) . '/' . substr(tep_date_short($order->info['date_purchased']), 6, 4) ); germ, Yep that is a very good work around. Thanks for the help. Ryan. Quote Ryan, Australia Link to comment Share on other sites More sharing options...
dzina Posted June 18, 2013 Share Posted June 18, 2013 I know this is an old thread but I need help on the same Module, so thought i would use it. I need the product attributes to appear in the invoice. Can anyone help me do this? Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.