1

APIを使用してMagentoでカテゴリを作成しようとしています。コードを使用して、カテゴリごとにエラーをスローします。

categoryEntity = new catalogCategoryEntityCreate();

string[] sortby_values;
    sortby_values = cat.available_sort_by.ToString().Split(',');
    currstore = 1;
//string[] sortby = new[] { "name", "price" };
string[] sortby;
sortby = sortby_values;// new[] { "name", "price" };
categoryEntity.available_sort_by = sortby;
rtbState.Text += "testing";
categoryEntity.default_sort_by = cat.default_sort_by; // "name";
//categoryEntity.available_sort_by = null;
//categoryEntity.default_sort_by = null;
categoryEntity.description = null;
categoryEntity.is_active =                           Convert.ToInt16(rectify_option(cat.is_active.ToString()));
categoryEntity.is_activeSpecified = cat.is_activeSpecified;
categoryEntity.include_in_menu = Convert.ToInt16(rectify_option(cat.include_in_menu.ToString()));
categoryEntity.include_in_menuSpecified = cat.include_in_menuSpecified;
categoryEntity.name = cat.Name;
WriteLine("Category with code : " + categoryEntity.name + " Created in magento Successfully.");
if (cat.Is_Anchor == Is_Anchor.Yes)
    categoryEntity.is_anchor = 1;
else
    categoryEntity.is_anchor = 0;
categoryEntity.is_anchorSpecified = true;
try
{   
    int categoryid = proxy.catalogCategoryCreate(sessionId, cat.parent_category_id , categoryEntity, "1" );
}

この最後の行でエラーがスローされます。エラーは次のとおりです。非オブジェクトのメンバー関数getId()を呼び出す

4

1 に答える 1

0

これはmagento 1.7.0.3の問題です。1 つの設定を変更する必要があります。admin/system/configuration/extensions/dropdownmenu を無効にします (フィールド名を有効にする) ドロップダウンを無効にします。APIを使用してカテゴリを正常に作成するようになりました..

于 2012-10-20T07:20:03.883 に答える