Search code examples
prestashop-1.6csv-import

prestashop 1.6 csv imported products editing error


On my prestashop store (version: 1.6.0.6), I used the csv import to import products. It did its job and imported the product.

When i tried editing the product (actually disabling the product), there appears two errors

2 errors Products must be in at least one category. This product must be in the default category.

When i looked under the association tab the categories are there and even the default category is the first selected category.

I tried to save again and it was successful.

The problem here is that the categories error appears only when i do not change tab on the product edit section.

Need quick solution.


Solution

  • I had a similar error. Creating products and category from csv file, all products always had the category Home and not the category that appeared in the csv file. When i looked under the association tab the categories are there.

    This is not maybe the better solution, but I run the following trigger on my MySql database:

     CREATE TRIGGER `solution` AFTER INSERT ON `ps_category_product`
     FOR EACH ROW update ps_product a1,ps_product_shop b1
        set a1.id_category_default=NEW.id_category,b1.id_category_default=NEW.id_category
        where a1.id_product=NEW.id_product AND b1.id_product=NEW.id_product
    

    You need change the prefix "ps_" and write prefix of your database.

    Maybe will solve your problem too. I hope you find it useful.