在Magento文档中,在创建目录类别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,
)));
有人知道它是什么吗?
它是您正在创建的类别的parent_id值。在默认的Magento设置中,"默认类别"id是2,在"根目录"下。