Community Forums

Fatal error: Call to undefined method ModelSaleOrder

Bug reports here

Fatal error: Call to undefined method ModelSaleOrder

Postby fadomain » Sat Oct 08, 2011 9:46 am

Fatal error: Call to undefined method ModelSaleOrder::getOrderOption() in /home/deb44075/domains/myrali.nl/public_html/winkel/admin/controller/sale/order.php on line 1783

This is what I get when loged in as admin and do a SALES/ORDER/VIEW/products selection and than click on an uploaded picture

This is the url produced by the procedure
http://www.myrali.nl/winkel/admin/index ... ption_id=6

The picture is in the directory download with added a codeword behind the filetype
The picture is owned by user apache not by the owner of the application.
I tried with reset owner to the application owner but this has no effect what so ever

Version of opencart is the last

v1.5.1.3 is instaled with instalitron of my provider

Hope someone can help me
fadomain
 
Posts: 8
Joined: Sat Oct 08, 2011 9:33 am

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby Daniel » Sat Oct 08, 2011 11:52 am

i have no idea what you are talking about. undefined method and a picture.
OpenCart®
Project Owner & Developer.
OpenCart commercial support now available!
User avatar
Daniel
Administrator
 
Posts: 5173
Joined: Fri Nov 03, 2006 10:57 am

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby fadomain » Sat Oct 08, 2011 12:07 pm

Daniel wrote:i have no idea what you are talking about. undefined method and a picture.


On the new version its possible to upload a file as a customer when you order a product, its something to use with a printable product so you can use the file or picture to ad to your product.
on the admin pages its possible to view the order, in one of the links its possible to click on the name of the uploaded customer file, here is where I get the error. Hope this will help you understand better

if you want I can give you the admin password , it's only a test installation of opencart, I want to use the technology of customer file upload, to sell printable products.
fadomain
 
Posts: 8
Joined: Sat Oct 08, 2011 9:33 am

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby okmarket » Sun Oct 16, 2011 9:30 am

yes, after go to order for open att'd file, than have this warning

admin/controller/sale/order.php on line 1783

so how can we fix that? thank you.
China Wholesaler
http://www.okmarket.com
Image

David Wei
User avatar
okmarket
 
Posts: 51
Joined: Sat Jul 09, 2011 3:47 pm
Location: Guangzhou,China

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby okmarket » Sun Oct 16, 2011 9:40 am

for Fatal error: Call to undefined method ModelSaleOrder, i make two screenshot for your check it,pls advise how to fix it?
Attachments
problem1.JPG
problem1.JPG (39.07 KiB) Viewed 2829 times
problem2.JPG
problem2.JPG (36.24 KiB) Viewed 2829 times
China Wholesaler
http://www.okmarket.com
Image

David Wei
User avatar
okmarket
 
Posts: 51
Joined: Sat Jul 09, 2011 3:47 pm
Location: Guangzhou,China

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby banktp106 » Sun Nov 06, 2011 11:44 am

I've fixed

Open : admin/model/sale/order.php

add this method to this file

Code: Select all
public function getOrderOption($order_id, $order_option_id) {
      $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_option_id = '" . (int)$order_option_id . "'");
               
      return $query->row;
   }


hope this help!
banktp106
 
Posts: 15
Joined: Mon May 16, 2011 8:18 am

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby okmarket » Wed Nov 09, 2011 1:16 am

your code which order.php already have. so can you help to check it? tks.
China Wholesaler
http://www.okmarket.com
Image

David Wei
User avatar
okmarket
 
Posts: 51
Joined: Sat Jul 09, 2011 3:47 pm
Location: Guangzhou,China

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby JSR » Fri Dec 30, 2011 2:01 pm

banktp106 wrote:I've fixed

Open : admin/model/sale/order.php

add this method to this file

Code: Select all
public function getOrderOption($order_id, $order_option_id) {
      $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_option_id = '" . (int)$order_option_id . "'");
               
      return $query->row;
   }


hope this help!

Thanks for posting that fix. I just ran into the same issue with the error mentioned in the first post. This thread came up when I Google'd. With your fix, it works fine now. Thanks for taking the time to post the fix.
JSR
 
Posts: 7
Joined: Fri Dec 30, 2011 1:56 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby Concept211 » Thu Jan 05, 2012 9:16 pm

I updated the admin/model/sale/order.php and it no longer throws the error now.

However, now the file never downloads. The browser gets stuck trying to download the file and it never completes and finally the browser errors out and says it can't download the file. I can verify that the files exist in /store/download/ directory, but it seems that the code can't locate the file to serve it.

Any help would be greatly appreciated!
User avatar
Concept211
 
Posts: 39
Joined: Thu Oct 13, 2011 5:40 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby straightlight » Sat Jan 07, 2012 5:22 am

In your admin - > systems - > error logs, what does it report regarding this event ?
Regards,
Straightlight
straightlight
 
Posts: 1912
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby Concept211 » Sat Jan 07, 2012 5:30 am

straightlight wrote:In your admin - > systems - > error logs, what does it report regarding this event ?


That's what's strange, it's not throwing any errors at all. The error logs are blank. ???
User avatar
Concept211
 
Posts: 39
Joined: Thu Oct 13, 2011 5:40 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby straightlight » Sat Jan 07, 2012 5:56 am

Are at least one download file linked with an order option from the orders under the admin and from database ?
It is possible that you see no throwing errors from the event tracker due to empty results.
Regards,
Straightlight
straightlight
 
Posts: 1912
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby Concept211 » Sat Jan 07, 2012 12:48 pm

straightlight wrote:Are at least one download file linked with an order option from the orders under the admin and from database ?
It is possible that you see no throwing errors from the event tracker due to empty results.


I'm not sure exactly what you mean but attached are several screenshots to show you what's happening. You'll notice that the downloads just get "stuck" until they finally time out and fail. Everything else on the entire cart works perfectly except for this. You'll also see in the last screenshot that the JPG files DO exist on the server/FTP. Something is just wrong when serving up the file.

Thanks for your help!

Snap1.jpg
Snap1.jpg (100.2 KiB) Viewed 2538 times


Snap2.jpg
Snap2.jpg (167.41 KiB) Viewed 2538 times


Snap3.jpg
Snap3.jpg (147.11 KiB) Viewed 2538 times
User avatar
Concept211
 
Posts: 39
Joined: Thu Oct 13, 2011 5:40 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby Concept211 » Sat Jan 07, 2012 12:49 pm

Here are the other screenshots:

Snap4.jpg
Snap4.jpg (58.13 KiB) Viewed 2538 times


Snap5.jpg
Snap5.jpg (49.32 KiB) Viewed 2538 times
User avatar
Concept211
 
Posts: 39
Joined: Thu Oct 13, 2011 5:40 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby straightlight » Sun Jan 08, 2012 2:48 pm

Fixed. VQMod version ready. No core files modifications needed to install this fix as it is now cross-browsing compatible under PA-DSS Compliance and WCAG Compliance which the OC team didn't seem to have developed yet.

While the previous model fix above may had removed the error event issue on screen, the download header was not functioning correctly as without cross-browsing methodology when trying to download from the admin - > sales - > orders - > products tab on the left - > file name: filename.extension as a product option value file while the header being canceled to process the download. My fix should now handle all that. It also handles windows / linux, UNIX / MAC file path either from localhost or PCI Compliance servers.
Attachments
admin_product_option_download_fix_1_5_2_1.xml
v1.5.2.1
(5.13 KiB) Downloaded 64 times
admin_product_option_download_fix.xml
Product option download fix (PA-DSS Compliance and WCAG Compliance standards included). Also added the order option solution from the above.
(5.12 KiB) Downloaded 196 times
Last edited by straightlight on Sat Mar 17, 2012 5:34 pm, edited 2 times in total.
Regards,
Straightlight
straightlight
 
Posts: 1912
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby Concept211 » Sun Jan 08, 2012 3:03 pm

Wow, thank you so much straightlight! My experience with the OpenCart team and community has been nothing less than spectacular! I really appreciate all of the hard work everyone has put into such a great product and I hope to contribute more and more with everything that I can.
User avatar
Concept211
 
Posts: 39
Joined: Thu Oct 13, 2011 5:40 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby airtagmedia » Sun Jan 08, 2012 9:12 pm

Hi,

i am completely new to the realms of opencart (which is fantastic) and i have come up against the same error with the upload option - I noted your fix admin_product_option_download_fix.xml & the download /download/file.php?id=8977 and wanted to ask how i apply this?

I would be most greatful if someone could explain this to me.

Regards

Patrick
airtagmedia
 
Posts: 3
Joined: Sun Jan 08, 2012 9:01 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby straightlight » Sun Jan 08, 2012 9:21 pm

This fix is if you use VQMod on your OpenCart copy. If so, upload this XML file in your ./vqmod/xml folder as it should load automatically once you logged in into the admin - > sales - > orders page. :)

/download/file.php?id=8977


This URL link is simply the way phpBB from this forum generates the download link. There are no specific instructions based on this link other than clicking on the file to download it into your local environment.
Regards,
Straightlight
straightlight
 
Posts: 1912
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby airtagmedia » Sun Jan 08, 2012 11:24 pm

Thanks for your reply, I uploaded the xml file into the relevant folder vqmod/xml/file_name but i still encounter the following problem Fatal error: Call to undefined method ModelSaleOrder::getOrderOption() in /vqmod/vqcache/vq2-admin_controller_sale_order.php on line 1869. I am unsure if this is the same problem. (I realised the download reference was down to the bb and the way it handles links etc.)

I will have a tinker but would appreciate any input you could offer in resolving this issue.

regards

Patrick.
Last edited by airtagmedia on Mon Jan 09, 2012 2:23 am, edited 1 time in total.
airtagmedia
 
Posts: 3
Joined: Sun Jan 08, 2012 9:01 pm

Re: Fatal error: Call to undefined method ModelSaleOrder

Postby straightlight » Mon Jan 09, 2012 1:29 am

I have now updated my XML file which now includes this modification so that no one else uses a core modification when following this post: viewtopic.php?f=161&t=42888&p=237517#p234653 . All users who followed this instruction should rather remove this from the core file so during and after the upgrade you won't encounter the same error message in case this method is not being implemented by the OC team on the next release but rather be ran from my XML file during while.
Regards,
Straightlight
straightlight
 
Posts: 1912
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Next

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 9 guests

Hosted by Arvixe Web Hosting