adminraju123 Posted October 14, 2016 Share Posted October 14, 2016 When I am adding products through Admin in Prestashop , then it's not saved the Product and also not inserted to the database, why is this happening, please reply as soon as possible Link to comment Share on other sites More sharing options...
rocky Posted October 14, 2016 Share Posted October 14, 2016 Log in to your cPanel and make sure your MySQL user has permissions to INSERT into the database. You should give your MySQL user as many permissions as you can. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 18, 2016 Author Share Posted October 18, 2016 Yes, we enable that My SQL user permissions but still it's not inserting data Link to comment Share on other sites More sharing options...
rocky Posted October 18, 2016 Share Posted October 18, 2016 Sorry, I can't think of anything else that could cause it, unless you have an override that is stopping the ObjectModel class from saving data. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 18, 2016 Author Share Posted October 18, 2016 When we add a product in Prestashop and save it then it shows this error An error occurred while creating an object. product Link to comment Share on other sites More sharing options...
prestashopuser1337 Posted October 18, 2016 Share Posted October 18, 2016 You could take a look in the php error logs if thats possible. Link to comment Share on other sites More sharing options...
rocky Posted October 18, 2016 Share Posted October 18, 2016 That error message means there's a programming error in the SQL query that is saving to the ps_product tables. Try editing config/defines.inc.php and changing the value of _PS_MODE_DEV_ from false to true. That should display an error message showing the SQL query and the error message. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 18, 2016 Author Share Posted October 18, 2016 How to override ObjectModel class from saving data.How to fix this Link to comment Share on other sites More sharing options...
rocky Posted October 18, 2016 Share Posted October 18, 2016 It's better to try to fix the SQL error than try to override the ObjectModel class. Is there a detailed error message you can post here? Link to comment Share on other sites More sharing options...
adminraju123 Posted October 18, 2016 Author Share Posted October 18, 2016 Here is the detailed error message Fatal error: Class 'ProductController' not found in /home3/hireme/public_html/Cineultima.com/classes/controller/Controller.php on line 134 Please reply as soon as possible what to do now to fix this error Link to comment Share on other sites More sharing options...
rocky Posted October 18, 2016 Share Posted October 18, 2016 It seems something is trying to load the class ProductController, which doesn't exist. PrestaShop only has the class ProductControllerCore by default. Maybe there's an override that is extending the wrong class? Check whether override/controllers/front/ProductController.php exists. It's hard to know without actually inspecting your website. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 18, 2016 Author Share Posted October 18, 2016 No override/controllers/front/ in this path there are no ProductController.php exists Link to comment Share on other sites More sharing options...
rocky Posted October 18, 2016 Share Posted October 18, 2016 It would seem that some code is expecting there to be an override there and failing when it's not found. As a temporary fix, you can try creating override/controllers/front/ProductController.php with the following: <?php class ProductController extends ProductControllerCore { } This will create the class that the code is looking for, though it would really be better to know what code is attempting to call it. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 After doing the above Fatal error: Class 'ProductControllerCore' not found in /home3/hireme/public_html/Cineultima.com/override/controllers/front/ProductController.php on line 4 this type of error showing please reply as soon as possible Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2016 Share Posted October 20, 2016 It doesn't make any sense. That's a core class that should exist. Make sure controllers/front/ProductController.php exists and it contains <?php tag at the top and has the line class ProductControllerCore extends FrontController Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 Now in front end its showing perfect but admin panel its showing this type of error Duplicate entry '0' for key 'PRIMARY' INSERT INTO `cineultima_ps_product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `supplier_reference`, `location`, `width`, `height`, `depth`, `weight`, `quantity_discount`, `ean13`, `upc`, `cache_is_pack`, `cache_has_attachments`, `is_virtual`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`) VALUES ('1', '0', '0', '', '', '', '0', '0', '0', '0', '0', '', '', '0', '0', '0', '2', '2', '0', '0', '0', '1', '0', '0', '', '0', '0', '0', '0', '0', '1', '404', '0', '1', '0000-00-00', 'new', '1', '0', 'both', '0', '0', '2016-10-20 01:31:55', '2016-10-20 01:31:55', '3') Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 Please reply as soon as possible why this type of message is showing in admin panel Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2016 Share Posted October 20, 2016 That SQL query is missing the `id_product` field, so it's being inserted without a product ID, which is causing duplicates. I have no idea what would cause it. Maybe you should just start over with a clean installation of PrestaShop? Your current installation is seriously messed up. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 This is live Website and 244 products are there and i check in ps_product table there has id_product field Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2016 Share Posted October 20, 2016 I think it's going to hard to fix without actually inspecting your website. There must be an obscure bug somewhere. Perhaps the AUTO_INCREMENT on the ps_product table is wrong? You can change it using the query: ALTER TABLE ps_product AUTO_INCREMENT = 1000 Check the highest ID of your products and change 1000 in the query to the next ID after that one. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 In prestashop in database product_lang table why is this showing "Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available." how to fix this, please reply as soon as possible Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 Please reply this one Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2016 Share Posted October 20, 2016 Here's what my ps_product_lang table looks like on my PrestaShop v1.6.1.7 test site so you can compare. I'm not sure what version of PrestaShop you are using. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 This table looks like same what you sent but In prestashop in database product_lang table why is this showing "Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available." in prestashop is this table we can not edit delete data Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 My prestashop version is 1.6.1.1, please reply as soon as possible Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2016 Share Posted October 20, 2016 I don't have any further ideas. If the AUTO_INCREMENT query didn't fix the ps_product table SQL query error message, I don't know what will. Link to comment Share on other sites More sharing options...
adminraju123 Posted October 20, 2016 Author Share Posted October 20, 2016 ALTER TABLE ps_product AUTO_INCREMENT = 1000 what is the query if my highest id 427 , please reply this Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2016 Share Posted October 20, 2016 Try: ALTER TABLE ps_product AUTO_INCREMENT = 428 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