dasifred Posted July 5, 2015 Share Posted July 5, 2015 (edited) Hello, After installing a new theme (purchased on addons prestashop ), I am unable to create products , here is the error message : Bad SQL Query Unknown column ' image_shop.id_product ' in ' on clause ' thank you for your help. Edited July 5, 2015 by dasifred (see edit history) 1 Link to comment Share on other sites More sharing options...
nolabel Posted July 6, 2015 Share Posted July 6, 2015 I have the same problem... Link to comment Share on other sites More sharing options...
rcho Posted July 7, 2015 Share Posted July 7, 2015 (edited) I also have the same problem.... I think it might be related to the fact that I upgrade to the latest Prestashop 1.6.1.0 version. It may be because the theme I am using is not compatible? Edited July 7, 2015 by rcho (see edit history) Link to comment Share on other sites More sharing options...
arnaud19951 Posted July 7, 2015 Share Posted July 7, 2015 I have the same problem if someone can help us to solve this problem it would be nice ! For me it also came when i changed theme on the prestashop 1.6.1 but not on the other version of prestashop Link to comment Share on other sites More sharing options...
dasifred Posted July 7, 2015 Author Share Posted July 7, 2015 Please find the solution You must modify the sql base https://github.com/PrestaShop/PrestaShop/blob/1.6/install-dev/upgrade/sql/1.6.1.0.sql#L91 good luck 1 Link to comment Share on other sites More sharing options...
rcho Posted July 7, 2015 Share Posted July 7, 2015 Thanks for the response dasifred. I apologize but I am newbie here. Could you elaborate a little bit on how I would make the change that you highlighted? Link to comment Share on other sites More sharing options...
arnaud19951 Posted July 8, 2015 Share Posted July 8, 2015 http://www.templatemonster.com/help/prestashop-1-6-x-how-to-fix-an-error-occurred-while-updating-an-object-product.html? this tuto worked for me Link to comment Share on other sites More sharing options...
rcho Posted July 9, 2015 Share Posted July 9, 2015 Thanks a lot arnaud19951. That helped a lot. I was able to get rid of the errors using the method described in the template monster tutorial. Not sure if I did everything correctly but I guess I'll find out later.... Link to comment Share on other sites More sharing options...
med.attaouile Posted July 18, 2015 Share Posted July 18, 2015 Hi dasifred Can you expline to me please I have the same problem I dont Know what should I update on the Database Thank You Please Help me Link to comment Share on other sites More sharing options...
Klayton2112 Posted August 6, 2015 Share Posted August 6, 2015 Same problem here: Bad SQL queryUnknown column 'image_shop.id_product' in 'on clause' Any solutions? I've installed a template from template monster! Link to comment Share on other sites More sharing options...
rcho Posted August 6, 2015 Share Posted August 6, 2015 I had this problem when I installed a template from Template Monster as well. I don't know if it is a proper fix but if you follow the instructions from post #7, the problem doesn't show up anymore. http://www.templatemonster.com/help/prestashop-1-6-x-how-to-fix-an-error-occurred-while-updating-an-object-product.html? You need to create table entries for the missing columns. Note that I ran into another 3-4 similar problems after "image_shop.id_product" was fixed. My recommendation is to go with another template from somewhere else. I ran into a ton of problems with Template Monster templates. I am using a template from themeforest.net and those are much better. They are much easier to configure and customize. Here is a blog that I read which convinced me to try themeforest. https://dh42.com/blog/template-monster-themes-suck/ If you really want to use the template from Template Monster, I would suggest using the exact same version of Prestashop that is listed in the details page of your template. That way you can avoid these SQL query problems. Link to comment Share on other sites More sharing options...
Klayton2112 Posted August 6, 2015 Share Posted August 6, 2015 I had this problem when I installed a template from Template Monster as well. I don't know if it is a proper fix but if you follow the instructions from post #7, the problem doesn't show up anymore. http://www.templatemonster.com/help/prestashop-1-6-x-how-to-fix-an-error-occurred-while-updating-an-object-product.html? You need to create table entries for the missing columns. Note that I ran into another 3-4 similar problems after "image_shop.id_product" was fixed. My recommendation is to go with another template from somewhere else. I ran into a ton of problems with Template Monster templates. I am using a template from themeforest.net and those are much better. They are much easier to configure and customize. Here is a blog that I read which convinced me to try themeforest. https://dh42.com/blog/template-monster-themes-suck/ If you really want to use the template from Template Monster, I would suggest using the exact same version of Prestashop that is listed in the details page of your template. That way you can avoid these SQL query problems. Mmmmm no, the solution on post #7 doesn't work for me. Can't find tables... I had to contact the support team and ask what's the problem... Obviously SQL. The answer was that the theme was supposed to be installed in the version 1.6.0.9, and ONLY later you can update to the lastest version 1.6.1.0 Yesterday I've installed the version 1.6.1.0 in a new website and after the template, so I've got the problem. The interesting part is that on addons.prestashop the theme compatibility was from 1.6.0.4 to 1.6.1.0... I think this is not a good way to promote templates... Link to comment Share on other sites More sharing options...
rcho Posted August 6, 2015 Share Posted August 6, 2015 Yeah. I got the same response when I asked support team. It worked better when using the theme with 1.6.0.9. However, I still had other problems with the customization of the theme. I would recommend that you take a look at the themes at themeforest.net. Template Monster has nice looking themes but they were a pain for me to work with. Link to comment Share on other sites More sharing options...
marczoo Posted August 7, 2015 Share Posted August 7, 2015 (edited) Just execute this SQL ALTER TABLE ps_image_shop ADD `id_product` int(10) unsigned NOT NULL, ADD KEY `id_product` (`id_product`, `id_shop`, `cover`); Edited August 7, 2015 by marczoo (see edit history) 10 Link to comment Share on other sites More sharing options...
med.attaouile Posted August 7, 2015 Share Posted August 7, 2015 Hellow , The problem is that the version of prestashop is not compatible with the template. So the solution : you verify the version whos compatible with your template and repeat all stapes of installation Good luck Link to comment Share on other sites More sharing options...
Jiabin Posted August 15, 2015 Share Posted August 15, 2015 (edited) Just execute this SQL ALTER TABLE ps_image_shop ADD `id_product` int(10) unsigned NOT NULL, ADD KEY `id_product` (`id_product`, `id_shop`, `cover`); it works fine for me! many thanks marczoo! 16-8-2015 update: out of the box the marczoo workaround seems to work but it's possible that, modifiying the table you can introduce instability and entropy, as example now when i try to add an image to a product i get an error, if i look directly on phpMyAdmin i saw the backtrace: Notice in ./libraries/tbl_columns_definition_form.inc.php#55 Undefined variable: server Backtrace ./libraries/structure.lib.php#2453: include(./libraries/tbl_columns_definition_form.inc.php) ./tbl_structure.php#45: PMA_displayHtmlForColumnChange( string 'AEGUADE5TERE', string 'ps_image_shop', NULL, string 'tbl_structure.php', ) Edited August 16, 2015 by Jiabin (see edit history) Link to comment Share on other sites More sharing options...
ronelgon Posted September 26, 2015 Share Posted September 26, 2015 Hello, Iam getting this issue:Bad SQL Query Unknown column ' image_shop.id_product ' in ' on clause ' But when i enabled error report, i got the information below. 760. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 761. } 762. elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) 763. { 764. if ($sql) 765. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>'); 766. 767. throw new PrestaShopDatabaseException($this->getMsgError()); 768. } 769. } 770. What could be the problem? You help will be highly appreciated Thank you Ronnie Link to comment Share on other sites More sharing options...
romone2 Posted November 26, 2015 Share Posted November 26, 2015 Just execute this SQL ALTER TABLE ps_image_shop ADD `id_product` int(10) unsigned NOT NULL, ADD KEY `id_product` (`id_product`, `id_shop`, `cover`); Thanks a lot, works very well !! Link to comment Share on other sites More sharing options...
traketo Posted January 6, 2016 Share Posted January 6, 2016 Just execute this SQL ALTER TABLE ps_image_shop ADD `id_product` int(10) unsigned NOT NULL, ADD KEY `id_product` (`id_product`, `id_shop`, `cover`); I had the same problem when trying to upload a database backup from 1.6 to a test site on 1.6.1.3. This solved the issue. Thank you! Link to comment Share on other sites More sharing options...
babyscloset Posted October 15, 2016 Share Posted October 15, 2016 Hi I get the same error, so i am not able to add products Error: Unknown column 'image_shop.id_product' in 'on clause' I have tried al the things that are mentioned here. When I add a SQL I get the error that I need to sellect a database, but I only have one database. I have prestashop 1.6.1.6 Can somebody help me? Thanks Link to comment Share on other sites More sharing options...
rocky Posted October 16, 2016 Share Posted October 16, 2016 You still need to click on your database name even if you have only one, then you can go to the SQL tab and enter your query and it should work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now