Closed mittus closed 7 years ago
Everything works as usual here, do you get an error message? Did you know that the "new Item(ID)" should contain an ID of an existing category?
No, I haven't message, when I use this construction, nothing happens. I use id my category (1).
I can't reproduce it, sorry. But ItemManager uses the same API function call to creating its items in admin area.
Than'k you. I will search this problem and write here about this.
Ok, you can check whether your item object created before you save:
$item = new Item(your_cat_id);
$item->name = 'My item name';
Util::preformat($item);
I will close this issue for now until I can reproduce this error
Hello!
I can use this construction only with $imanager = new IManager();
It's work for me:
function test() {
$imanager = new IManager();
$item = new Item(1);
$item->name = 'New Item';
$item->save();
}
Hmm, I thought you had already done that. Of course, you need to create an ItemManager instance first ;-) Do this:
imanager();
$item = new Item(1);
$item->name = 'New Item';
$item->save();
new IManager()
is deprecated
Thank you very much, it's work!!
You are welcome!
Hello!
I can't use construction: $item = new Item(1); $item->name = 'My item name'; $item->save();
In ItemManager nothing appears :(
List my all plugins: http://prntscr.com/gfb2cc Category: http://prntscr.com/gfb2sy