Page 2 of 4

Re: opencart !

Posted: 13 Mar 2012, 18:31
by bigj2552
Mattie;42274 wrote:That's got me stumped i'm afraid mate never came across this problem before. You might get quick response to that problem on the opencart forum
....opencart forum !......i havnt got wks to wait for an answer over there......and thats if i even get a reply.....:rolleyes:

waste of time over there.....get more help from google search and youtube than you do over on there forums

Re: opencart !

Posted: 13 Mar 2012, 18:56
by Mattie
sometimes it depends on your question, i've had a reply in minutes and as you say sometimes never lol

Re: opencart !

Posted: 13 Mar 2012, 23:31
by JSR
bigj2552;42256 wrote:i got where it is m8 but when i d/l it i get this instead of the image


Fatal error: Call to undefined method ModelSaleOrder::getOrderOption() in /var/www/vhosts/kustomdesign.co.uk/httpdocs/admin/controller/sale/order.php on line 1783
It's a known bug. If you search the OpenCart forum, you would have found the solution.

To save time, here it is:

Open /admin/model/sale/order.php

Look for where it shows:

Code: Select all

	public function getOrderOptions($order_id, $order_product_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$order_product_id . "'");

		return $query->rows;
	}
	
	public function getOrderTotals($order_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order");

		return $query->rows;
	}
Add in the following code that I've highlighted in bold (feel free to copy & paste it):

Code: Select all

	public function getOrderOptions($order_id, $order_product_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$order_product_id . "'");

		return $query->rows;
	}

[B]	public function getOrderOption($order_id, $order_option_id) { // added by JSR
          $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;
       }
[/B]
	public function getOrderTotals($order_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order");

		return $query->rows;
	}
(I always add a note such as " // added by JSR" to remind me that I've changed something from the original file - you may want to do the same.) Keep a copy of the unaltered original, in case you accidentally change something else (you can just put the original back).

Save & upload the corrected file and you should find it works just fine.

Re: opencart !

Posted: 14 Mar 2012, 01:18
by bigj2552
works perfect JSR....many thanks for your input.....
Guess i will need to troll though the opencart forums more :rolleyes:......trying to get info on there seems to be a bloody nightmare...or is it just me ?


anyway....
thanks again :redface:

johnny....

Re: opencart !

Posted: 14 Mar 2012, 06:48
by smitch6
99% of any problems you have has already been had by someone else

as ppl always say the search feature is your friend
if you make new posts asking the same thing ppl won't reply to you

Re: opencart !

Posted: 14 Mar 2012, 10:40
by bigj2552
smitch6;42329 wrote:99% of any problems you have has already been had by someone else

as ppl always say the search feature is your friend
if you make new posts asking the same thing ppl won't reply to you


not that simple steve....over there anyway....

so many variations of words/sentences to search for and......

it takes ages to sort through the dribble some people post before you get anywhere near what you are looking for....

but, in saying that.....
i had a good 1.5hrs last night trollin through some of the dribble and came back with a few more solutions...some i was looking for, and some, i wasnt....
so yes, it pays to go through the dribble lol

Re: opencart !

Posted: 15 Mar 2012, 00:21
by JSR
bigj2552;42325 wrote:works perfect JSR....many thanks for your input.....
Glad I could help.
bigj2552;42325 wrote:Guess i will need to troll though the opencart forums more :rolleyes:......trying to get info on there seems to be a bloody nightmare...or is it just me ?
The trouble is that OpenCart is run by two guys (well, just one really), and if he doesn't experience the problem or he doesn't see it as important, it's not a priority to fix it.

An example of this was the old "image/logo doesn't show in email" chestnut. It only happened on certain email software. The problem was two-fold. One was that he'd misworded the encoding for the image, and the other was a missing extension (like .jpg). Some email software would cover for such faults, but others are more strict (presumably for security reasons).

The fixes were simple enough to implement but, because OpenCart's primary coder didn't use one of the effected email apps he didn't see the problem and so didn't fix it (his solution was to use the email app that he used!). It was up to others to fix it. Someone else had posted the fix for the first issue, but I couldn't find a fix for the second. So I trawled through the relevant files to see if I could find the problem and, once found & fixed, I posted it in a thread from someone else posting the same problem.

That's free software all over, I'm afraid. I had to do a similar thing with a module for ZenCart some years ago, too. You have to expect to fix issues yourself if you can't find the solution already posted. There's no guarantee that you wouldn't experience the same thing with paid-for software, but at least if you pay you have a right to gripe at them for bugs. :wink:

Re: opencart !

Posted: 07 May 2012, 16:04
by bassqee
Playing about with open cart to see what it can do. How do I go about adding an upload feature for clients? Search the open cart forums but can't actually see how its done.

Re: opencart !

Posted: 07 May 2012, 16:27
by JSR
bassqee;45217 wrote:Playing about with open cart to see what it can do. How do I go about adding an upload feature for clients? Search the open cart forums but can't actually see how its done.
In Admin - Catalog - Options, create a new Option called "Upload Image" and select File/File in the "Type" dropdown box. Click "Save".

In Admin - Catalog - Products, select or create your product. In the "Option" tab of that product, begin typing "Upload Image" in the box with the green + next to it and you should be able to select the "Upload Image" option you previously created. Click the green + button, then click "Save".

You should now find that the "Upload Image" file box appears on the product page.

Re: opencart !

Posted: 07 May 2012, 16:31
by bassqee
thank you!