Answer the question
In order to leave comments, you need to log in
How to update the category parent in MySklad?
On the site, when editing categories, you can change the parent.
For the given parent, I have externalCode
.
The documentation says what needs to be updated $item->productFolder
.
I try to update like this:
$item->name = $new['name'];
$item->description = htmlspecialchars_decode($new['description']);
$parent_id = 'cd1676e3-5a04-11e9-9ff4-31500040606a';
$item->relations->productFolder->fields->meta->href = 'https://online.moysklad.ru/api/remap/1.1/entity/productfolder/' . $parent_id;
$item->relations->productFolder->fields->meta->uuidHref = 'https://online.moysklad.ru/app/#good/edit?id=' . $parent_id;
$res_ms = $item->buildUpdate()->execute();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question