After importing a Thelia 1 database to a Thelia 2.2.1 platform,
I've been trying to apply a php script to do some cleaning.
Especially, I've been trying to move the products from the imported categories to new ones.
The products are removed from the old category, I can see that in the backoffice,
but the new category is still empty. Apparently something is missing in my script.
basically, what I do is :
$product->addCategory($category);
$product->removeCategory($t1Category);
$productCategories = $product->getProductCategories();
$productCategories[0]->setDefaultCategory(1);
$productCategories->save();
$product->save();
Does anybody would have an idea about what I'm missing ?
thanks for the help,
loïc b.
Last edited by neywen (04-01-2016 15:33:02)