Jump to content

Update sub category with api webservices


Sevarf2
 Share

Recommended Posts

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More