Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Soap 如何在Magento APi上创建子类别_Soap_Magento_Soap4r - Fatal编程技术网

Soap 如何在Magento APi上创建子类别

Soap 如何在Magento APi上创建子类别,soap,magento,soap4r,Soap,Magento,Soap4r,我目前正在使用Magento版本。1.5.0.1. 谁能告诉我如何使用soapv2创建子类别 这里是我的代码格式 category_data = { "name" => "LIGHTING", "is_active" => 1 } soap.call('catalogCategoryCreate',session,4,category_data,1, "include_in_menu") 我运行此代码时出现了一些错误 : Attribute "include_in_menu" is

我目前正在使用Magento版本。1.5.0.1. 谁能告诉我如何使用soapv2创建子类别

这里是我的代码格式

category_data = { "name" => "LIGHTING", "is_active" => 1 }
soap.call('catalogCategoryCreate',session,4,category_data,1, "include_in_menu")
我运行此代码时出现了一些错误

: Attribute "include_in_menu" is required. (SOAP::FaultError)
这是解决这个问题的办法吗


谢谢。

这是使用SOAP V2创建类别的方法

category_data = { "name" => "LIGHTING", "is_active" => 1, "include_in_menu" => 1 }
<?php
    $host = "192.168.0.10/~aliasgar/magentoext/index.php"; //our online shop url
    $client = new SoapClient("http://".$host."/api/v2_soap/?wsdl"); //soap handle
    $apiuser= "aliasgar"; //webservice user login
    $apikey = "aliasgar"; //webservice user pass
    try { 

    $sess_id= $client->login($apiuser, $apikey); //we do login

    $result = $client->catalogCategoryCreate($sess_id, 3, array(
        'name' => 'Test Category',
        'is_active' => 1,
        'available_sort_by' => array('position'),
         'default_sort_by' => 'position',
        'include_in_menu' => '1',
    ));

    var_dump ($result);
    }
    catch (Exception $e) { //while an error has occured
        echo "==> Error: ".$e->getMessage(); //we print this
           exit();
    }


catalogCategoryCreate函数中的3是父类别id。

这是使用SOAP V2创建类别的方法

<?php
    $host = "192.168.0.10/~aliasgar/magentoext/index.php"; //our online shop url
    $client = new SoapClient("http://".$host."/api/v2_soap/?wsdl"); //soap handle
    $apiuser= "aliasgar"; //webservice user login
    $apikey = "aliasgar"; //webservice user pass
    try { 

    $sess_id= $client->login($apiuser, $apikey); //we do login

    $result = $client->catalogCategoryCreate($sess_id, 3, array(
        'name' => 'Test Category',
        'is_active' => 1,
        'available_sort_by' => array('position'),
         'default_sort_by' => 'position',
        'include_in_menu' => '1',
    ));

    var_dump ($result);
    }
    catch (Exception $e) { //while an error has occured
        echo "==> Error: ".$e->getMessage(); //we print this
           exit();
    }

这里catalogCategoryCreate函数中的3是父类别id。

可能相关。可能有关联。