Page 1 of 1

error 1054

Posted: Tue Nov 10, 2009 8:16 am
by 908nuday19
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.

Re: error 1054

Posted: Tue Nov 10, 2009 8:36 am
by Daniel
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'] . "'");


Re: error 1054

Posted: Tue Nov 10, 2009 9:52 am
by 908nuday19
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

Re: error 1054

Posted: Tue Nov 10, 2009 11:24 am
by digitalchaos
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