Post by 908nuday19 » Tue Nov 10, 2009 8:16 am

I got this error when I went for checkout :

unknown: Unknown column 'discount' in 'field list'
Error No: 1054
INSERT INTO order_product SET order_id = '18', product_id = '54', name = 'King Bonehead', model = 'King Bonehead', price = '12', discount = '0', total = '12', tax = '0', quantity = '1'


how do I fix this from happening? It was fine when I first tested my cart.

Newbie

Posts

Joined
Thu Oct 29, 2009 11:26 am

Post by Daniel » Tue Nov 10, 2009 8:36 am

intreasting.

which version are you using?

there is no discount filed in the lasest version.

did you try an upgrade then reverted back?

i'm assuming this is the line of code causing the trouble.

Code: Select all

			$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', quantity = '" . (int)$product['quantity'] . "'");


OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by 908nuday19 » Tue Nov 10, 2009 9:52 am

Yes, that is the code, when I checked my error log it said line 26 and this is what it showed:

$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', price = '" . (float)$product['price'] . "', discount = '" . (float)$product['discount'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', quantity = '" . (int)$product['quantity'] . "'");


Discount kept showing up more than it did in the line you just showed

Newbie

Posts

Joined
Thu Oct 29, 2009 11:26 am

Post by digitalchaos » Tue Nov 10, 2009 11:24 am

What happened here was the EnhancedOrderEmail_OCv132.3 mod was installed and the original catalog/model/checkout/order.php was not overwritten with the new file once the new order.php was uploaded everything worked again. no more error 1054

The most terrifying words in the English language are: I'm from the government and I'm here to help.
Ronald Reagan

Digital Chaos | Graphic Design Studio http://www.digitalchaos.biz
Digital Chaos Prints | Custom Art Prints http://www.digitalchaosprints.biz


User avatar
New member

Posts

Joined
Mon Sep 28, 2009 9:22 pm
Location - Paterson NJ
Who is online

Users browsing this forum: Baidu [Spider] and 8 guests