Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Create new Category through SOAP API Problem (1.1 Stable)
 
JKwan13
Member
 
Total Posts:  63
Joined:  2008-06-12
 

I’m having problems creating a category to link to a parent category through the SOAP API.

My code is:

$parentCategoryId 3;  //Root Catalog ID

// create new category
$newCategoryId $client->call($session,'category.create', array($parentCategoryId,
        array(
'name'=>'New Category Through Soap''is_active'=>1))
); 
 
var_dump($client->call($session'category.info', array($newCategoryId)));

Here’s the output:

array(10) { ["category_id"]=> string(2) “36” ["parent_id"]=> string(1) “0” ["is_active"]=> string(1) “1” ["position"]=> string(2) “30” ["level"]=> string(1) “1” ["created_at"]=> string(19) “2008-07-25 20:21:01” ["updated_at"]=> string(19) “2008-07-25 20:21:01” ["name"]=> string(25) “New Category Through Soap” ["url_key"]=> string(25) “new-category-through-soap” ["path"]=> string(3) “/36” }

The category is created, because I can navigate to it from: http://localhost/magento/index.php/admin/catalog_category/edit/id/36/ (Note the “36” from the “category_id” attribute), but it wont show up in the category listing or on the frontend.
I think the problem is that it won’t update the “parent_id” attribute to $parentCategoryId.

I’ve also tried:

$client->call($session'category.update', array(36, array('parent_id'=>3)));

I’m thinking it is a bug, but does anyone have ideas for a workaround?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JKwan13
Member
 
Total Posts:  63
Joined:  2008-06-12
 

Ok, I just posted a bug report for it, #6056.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Roderik
Member
 
Avatar
Total Posts:  35
Joined:  2007-09-15
Belgium
 

just found a workaround: http://www.magentocommerce.com/boards/viewthread/12681/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top