Add Category to Existing Product

Add category to your existing products in your prestashop store is very annoying especially if you had thousand of products. Sometime when we input products to prestashop, we forgot to check category that suit for the products.

Okay, if you facing the same problem with me. Please do the following to add category to your existing products.

1. Back up your database first.
2. Go to your PHPmyAdmin and run this query:

INSERT IGNORE INTO ps_category_product

SELECT 258(category where you want your products), id_product, 0

FROM ps_product

WHERE id_category != 2 && id_category != 72 && id_category != 80;

In the where statement put the categories you don't want! You have to do the categories you don't want and all the subcategories because ps_product only saves the default category!