Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding Order Date to Invoice & Packing Slip


Bluestcat

Recommended Posts

Could some kind soul please tell me how to add the order date to the invoice and packing slips? We are happy with them as we have modified them, but would really like to have the order date on them. Is this possible or do I have to start all over and download a contrib?

 

Thanks, Kimber

Link to comment
Share on other sites

Open /admin/invoice.php. After include(DIR_WS_CLASSES . 'order.php'); - insert this code:

 

//get the array from the result

$date = mysql_fetch_array($date_resource);

//get the date as a string from the result

$date_purchased = substr($date['date_purchased'], 5, 2) . '/' . substr($date['date_purchased'], 8, 2) . '/' . substr($date['date_purchased'], 0, 4);

 

Then add this new row in between your shipping and payment rows:

 

<tr>

<td colspan="2">

<table border="0">

<tr>

<td class="main"><b><?php echo 'Order Date: '; ?></b></td>

<td class="main"><?php echo $date_purchased; ?></td>

</tr>

</table>

</td>

</tr>

Link to comment
Share on other sites

  • 5 weeks later...
Open /admin/invoice.php. After include(DIR_WS_CLASSES . 'order.php'); - insert this code:

 

//get the array from the result

$date = mysql_fetch_array($date_resource);

//get the date as a string from the result

$date_purchased = substr($date['date_purchased'], 5, 2) . '/' . substr($date['date_purchased'], 8, 2) . '/' . substr($date['date_purchased'], 0, 4);

 

This doesn't work and gives the following error.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

Any ideas.

Thanks, Kimber

Link to comment
Share on other sites

I have seen these errors on older versions of OSC. What version are you running?

 

Are you are sure you added that code I gave you correctly (it was copied and pasted from a fully functioning, order date including invoice page)...

Link to comment
Share on other sites

I have seen these errors on older versions of OSC. What version are you running?

 

Are you are sure you added that code I gave you correctly (it was copied and pasted from a fully functioning, order date including invoice page)...

 

 

Yes, I cut and pasted your code following the insertion directions. I am using osCommerce 2.2 Milestone 2, Update 051113

 

Thanks for your help!

Kimber

Link to comment
Share on other sites

Wait a minute ...

 

Are you are sure you added that code I gave you correctly (it was copied and pasted from a fully functioning, order date including invoice page)...

 

My invoice page was just the standard invoice page with osCommerce, which didn't include the order date. I modified the page the way that the client wished and wanted to add the order date to it. Was your code for a different invoice page, other than the standard osCommerce supplied one?

 

Thanks, Kimber

Link to comment
Share on other sites

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...