简体   繁体   中英

magento sample for creating catalog issue

In the Magento documents, in creating a catalog category api , there are few examples where there is parameter that is set to 2 but there is not explanation what is actually is!

2 is just used.

$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,
)));

anyone knows what is it?

It is parent_id value for the category you are creating. In default Magento setup, "default category" id is 2, under "root catalog".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM