Page 1 of 1

1.1.7 - error on checkout

Posted: Sun Feb 15, 2009 9:29 am
by nde
This error occurs when I try to place an order, after I've chosen the payment method (?route=checkout/confirm):

Code: Select all

Error: Unknown column 'product_id' in 'field list'
Error No: 1054
INSERT INTO order_product SET order_id = '10', product_id = '43', name = 'MacBook', model = 'Product 16', price = '500', discount = '0', total = '500', tax = '0', quantity = '1'

Re: 1.1.7 - error on checkout

Posted: Sun Feb 15, 2009 9:41 am
by Daniel
add this in you SQl manager:

ALTER TABLE `order_product` ADD `product_id` INT( 11 ) NOT NULL AFTER `order_id`;


http://forum.opencart.com/index.php/topic,3056.0.html

Re: 1.1.7 - error on checkout

Posted: Sun Feb 15, 2009 10:09 am
by nde
Thanks for the quick help. I just ran the query but the error still occurs.
It's a fresh 1.1.7 install.

Re: 1.1.7 - error on checkout

Posted: Sun Feb 15, 2009 10:14 am
by Daniel
open phpmyadmin and check if the field is there manually.

Re: 1.1.7 - error on checkout

Posted: Mon Feb 16, 2009 8:50 am
by ksjones
Adding the field worked fine, will you be creating a new package of the installer for this?

Quick suggestion for future development and bug fixes to the DB, could you add a SQL extension where the DB can have SQL commands executed to it? That way you can supply upgrade scripts that alter the DB structure and users would only need to upload new files.

Cheers K

Re: 1.1.7 - error on checkout

Posted: Mon Feb 16, 2009 9:39 am
by Daniel
ksjones wrote: Adding the field worked fine, will you be creating a new package of the installer for this?

Quick suggestion for future development and bug fixes to the DB, could you add a SQL extension where the DB can have SQL commands executed to it? That way you can supply upgrade scripts that alter the DB structure and users would only need to upload new files.

Cheers K
no because it makes the whole system insecure!

Re: 1.1.7 - error on checkout

Posted: Mon Feb 16, 2009 10:08 am
by nde
Daniel wrote: open phpmyadmin and check if the field is there manually.
Sorry, I had the wrong database, it works. Your fix helped.

Re: 1.1.7 - error on checkout

Posted: Tue Feb 17, 2009 7:50 am
by donb
I have done everything here and still get the error.  Here is a screen shot of my order_product table.

http://img.skitch.com/20090216-cphq2a5f ... review.jpg[/img]
Click for full size - Uploaded with plasq's Skitch

I apologize in advance for not being an mySQL wizard. 

Here is the error I am receiving.

Code: Select all

Error: Unknown column 'product_id' in 'field list'
Error No: 1054
INSERT INTO order_product SET order_id = '4', product_id = '49', name = 'Fireball Tim's "HOLLYWOOD MOVIE CAR" Design Book ', model = 'fbb001', price = '2.5', discount = '0', total = '2.5', tax = '0', quantity = '1'

Re: 1.1.7 - error on checkout

Posted: Tue Feb 17, 2009 7:58 am
by fido-x
You need to run this as an SQL query against your database --

Code: Select all

ALTER TABLE `order_product` ADD `product_id` INT( 11 ) NOT NULL default '0' AFTER `order_id`;
to put the "product_id" field in the table.

Re: 1.1.7 - error on checkout

Posted: Fri Feb 20, 2009 12:48 am
by donb
That did the trick and I'm able to take payment. I had to manually enter the field into the table however. Thanks!