$categories = $this->getCategories($sub_cats);
$product->addToCategories($categories);
foreach ($categories as $category) {
$product->category[] = $category;
}
This code works good when i want to add product categories but i cannot change id_category_default
How can i change the default category info ?