Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PDF Invoice 162 Order date format change


Ozmooseus

Recommended Posts

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.

Ryan,

Australia

Link to comment
Share on other sites

In /catalog/includes/languages/english.php make the date format this:

 

define('DATE_FORMAT', 'd/m/Y'); // this is used for date()

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

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.

Ryan,

Australia

Link to comment
Share on other sites

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 by germ

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

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.

Ryan,

Australia

Link to comment
Share on other sites

  • 2 years later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...