Sevarf2 Posted May 6, 2022 Share Posted May 6, 2022 Hello, I need tp update the subcategories using the webservice api. I'm able to update the main categories using this code $mycategories = array(1,2,3,4,5); unset($item->associations->categories); $categories = $item->associations->addChild('categories'); foreach( $mycategories as $cat ){ $category = $categories->addChild('category'); $category->addChild('id', $cat); } } and I tried to apply the same logic with sub categories, adding another associations item to the category and again categories and category but it's not doing anything. $category->addChild('associations')->addChild('categories')->addChild('category'); Thanks Link to comment Share on other sites More sharing options...
Sevarf2 Posted May 6, 2022 Author Share Posted May 6, 2022 my bad, sub categories work as main categories... 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