hitstore Posted February 27, 2014 Share Posted February 27, 2014 Hi to everybody,I already posted this question in another thread (italian forum), but apparently nobody has got an opinion/solution.Weel, to update the quantities available and prices for sale I override some existing products through the csv import.Csv file contains only the id, product name, quantity and the selling price including tax.The system is working properly and the updates are ok, but product updated change categories and back to being in the category "home". I do not think it is a normal thing, since all other data products are not affected by changes (tags, pictures, cards, etc. ..). In my operations i never use category field, but apparently, this field is overrides with a default value (1).Does anyone have an opinion ( maybe a solution ) ? Thanks Link to comment Share on other sites More sharing options...
parsifal Posted March 25, 2014 Share Posted March 25, 2014 (edited) I think this is a bug. I experienced this in v1.5.3.1. What is your PS version? Also, does anyone know if this bug is still present in v1.6 branch? Edited March 25, 2014 by parsifal (see edit history) Link to comment Share on other sites More sharing options...
kingcheetah Posted May 13, 2014 Share Posted May 13, 2014 I have excact the same problem as Hitstore post. My version is 1.4.4.1 I don't want to update, have some of you a solution to this bug? Link to comment Share on other sites More sharing options...
josema33 Posted December 26, 2014 Share Posted December 26, 2014 hello my prestashop version is 1.6.0.9 The csv import changes my default category not contain this field in the import. The solution: In the file /controllers/admin/AdminImportController.php Change the line 1435 $product->id_category_default = isset($product->id_category[0]) ? (int)$product->id_category[0] : ''; for this if (isset($info['category'])) { $product->id_category_default = isset($product->id_category[0]) ? (int)$product->id_category[0] : ''; } I hope that works for them. Link to comment Share on other sites More sharing options...
Simonkl Posted March 13, 2015 Share Posted March 13, 2015 (edited) hello my prestashop version is 1.6.0.9 The csv import changes my default category not contain this field in the import. The solution: In the file /controllers/admin/AdminImportController.php Change the line 1435 $product->id_category_default = isset($product->id_category[0]) ? (int)$product->id_category[0] : ''; for this if (isset($info['category'])) { $product->id_category_default = isset($product->id_category[0]) ? (int)$product->id_category[0] : ''; } I hope that works for them. Great! Now is the question for 1.000.000$! How to do this in Prestashop Cloud? There is no access to the files in the /controllers/ folder, Any good ideas? I´ve heard something about using overrides, but I have no idea how that works, and if it would apply in this case. This is a huge problem that needs to be addresses asap! Without this change, it makes it impossible to manage a store that received updates on stock/price from external sources! Thanks. Simonkl Edited March 13, 2015 by Simonkl (see edit history) Link to comment Share on other sites More sharing options...
koyocik Posted April 11, 2016 Share Posted April 11, 2016 Great solution, but what changes to set for the 1.6.1.4? Link to comment Share on other sites More sharing options...
Divyesh Prajapati Posted June 21, 2016 Share Posted June 21, 2016 (edited) When you update product with import, There are two possibilities with category. 1. Not having category column. It will consider top first assigned category as default category. For ex. if your product is assigned to categories: 5# xyz, 10#abc, 4# hij; your current default category is 10. Now you are updating some data let's say qty and tax of product; as you haven't added categories it will consider current category tree and from it will get first category in ascending order and that is 4# hij as default category. 2. Having category column. If you add categories in category column you can enter comma separated list of categories and first category in that will be considered as default category of product. For ex. in category column if you enter "z, x, y, a" as categories of product; category z will be considered as default category of product. Edited June 21, 2016 by Divyesh Prajapati (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts