sinduda Posted September 4, 2007 Share Posted September 4, 2007 Hi- I'm trying to add an order date to a packing slip page that is being called from another pag. The order date works on the previos page, but not the packing slip.. <td width="25%" valign="top" class="packing"> Order Date:<?php echo $dateFormat->format($order->getOrderDate())?><br /> and getting this error... Order Date: Fatal error: Call to a member function on a non-object i have attached my code [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/67904-help-w-getting-order-date/ Share on other sites More sharing options...
hostfreak Posted September 4, 2007 Share Posted September 4, 2007 You need to create a new instance of the object. So: $dateFormat = new CLASSNAME //Change to your class name Edit: Also, I am assuming you will be including that page to a page that already includes/contains your class file. If not, then make sure to include the class file. Quote Link to comment https://forums.phpfreaks.com/topic/67904-help-w-getting-order-date/#findComment-341305 Share on other sites More sharing options...
hostfreak Posted September 4, 2007 Share Posted September 4, 2007 Sorry, I forgot the semicolon: $dateFormat = new CLASSNAME; //Change to your class name Quote Link to comment https://forums.phpfreaks.com/topic/67904-help-w-getting-order-date/#findComment-341313 Share on other sites More sharing options...
sinduda Posted September 4, 2007 Author Share Posted September 4, 2007 Thanks, I can't find any include files or classes that refer to that, can I just make a new classe for this page? If so how would that look like. Sorry, I'm very new to PHP. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/67904-help-w-getting-order-date/#findComment-341314 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.