2011-04-27 3 views
2

현재 Magento 버전을 사용 중입니다. 1.5.0.1. 누구든지 soapv2를 사용하여 하위 범주를 만드는 방법을 말해 줄 수 있습니까? 이 코드를 실행하면Magento APi에 하위 카테고리를 만드는 방법

여기 내 코드 형식

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) 

이 문제에 대한 해결책이 있습니까?

감사합니다.

+1

http://stackoverflow.com/questions/4604389/magento-create-category-with-soap-v2 가능성이 있습니다. – B00MER

답변

0
category_data = { "name" => "LIGHTING", "is_active" => 1, "include_in_menu" => 1 } 
0

이것은 당신이 catalogCategoryCreate 기능에 SOAP의 V2를 상위 카테고리 ID를

<?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(); 
    } 

?>

다음

3되어 사용 범주를 만들 수있는 방법이다.

관련 문제