Capfys Posted November 22, 2012 Share Posted November 22, 2012 (edited) Hello, I'm looking for a bit of help on a very annoying issue : We're using a specific software to manage our business in an actual shop, and we've installed a connector that is able to insert/update the products located in our software into prestashop. It worked juste fine but... Products are inserted without a category. So I scripted a few lines in SQL to tie my products to my categories. at this point : each product has a id_default_category field with the appropriate value in the product table, and each product is tied to its category in the category_product table. Except it doesn't work. In the products list in the admin, I can see the products' categories in the sortable listing, but it doesn't appear in edit mode and no products are found in any of the website categories. Additionnally, editing these products won't work, as they're labelled as 'previews/brouillons' So what did I miss ? What else do I have to do to bind my products to their categories ? Thanks for your help ! Edited November 22, 2012 by Capfys (see edit history) Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 23, 2012 Share Posted November 23, 2012 (edited) Hi, I use this code in my custom import script: ..... $category_array = array($product->id_category_default); ..... $product->addToCategories($category_array); ..... Regards Edited November 23, 2012 by Alexander Simonchik (see edit history) 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