在Magento文档中,在创建catalog category api时,很少有示例将参数设置为 2 ,但没有解释实际上是什么!
2 刚刚使用。
$result = $client->call($session, 'catalog_category.create', array(2, array( // <<-- what is this 2 ??
'name' => 'Category name',
'is_active' => 1,
'position' => 1,
//<!-- position parameter is deprecated, category anyway will be positioned in the end of list
//and you can not set position directly, use catalog_category.move instead -->
'available_sort_by' => 'position',
'custom_design' => null,
'custom_apply_to_products' => null,
'custom_design_from' => null,
'custom_design_to' => null,
'custom_layout_update' => null,
'default_sort_by' => 'position',
'description' => 'Category description',
'display_mode' => null,
'is_anchor' => 0,
'landing_page' => null,
'meta_description' => 'Category meta description',
'meta_keywords' => 'Category meta keywords',
'meta_title' => 'Category meta title',
'page_layout' => 'two_columns_left',
'url_key' => 'url-key',
'include_in_menu' => 1,
)));
谁知道它是什么?
答案 0 :(得分:1)
您正在创建的类别是parent_id值。在默认的Magento设置中,“默认类别”id在“根目录”下为2。