794_The.Definitive.Guide.to.Magento.pdf

Available data keys isactive incrementid name

Info icon This preview shows pages 258–262. Sign up to view the full content.

Available data keys: is_active increment_id name (required) url_key description image meta_title meta_keywords meta_description display_mode landing_page is_anchor available_sort_by (required) default_sort_by (required) custom_design custom_design_apply custom_design_from custom_design_to page_layout custom_layout_update
Image of page 258

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

APPENDIX API REFERENCES 237 Zend XML-RPC Example // Prepare the data $category_id = '15'; $data = array( 'description' => 'Colors available on request!', 'meta_keywords' => 'new colors' ); // using Zend XML-RPC method $result = $client->call('call', array($session_id, 'catalog_category.update', array($category_id, $data))); // returns true if update was successful var_dump($result); Method: catalog_category.move ($category_id, $parent_category_id, $after_category_id) Description: Moves the category under a specific parent. Return: Boolean; true if update was successful. Arguments: $category_id (required). The category_id to move. $parent_category_id (required). The destination for this move. $after_category_id (optional). You can place the category behind this child category_id. Zend XML-RPC Example // Prepare the data $category_id = '15'; $new_parent_category_id = '2'; // using Zend XML-RPC method $result = $client->call('call', array($session_id, 'catalog_category.move', array($category_id, $new_parent_category_id))); // returns true if update was successful var_dump($result); Note Make sure that you do not move the category under one of its children. Magento won’t halt the process. Both the category_id and the parent_category_id will be removed. There is no undoing once the move (or deletion) has occurred.
Image of page 259
APPENDIX API REFERENCES 238 Method: catalog_category.delete ($category_id) Description: Deletes the category. Return: Boolean; true if delete was successful. Argument: $category_id (required). The category_id to remove. Zend XML-RPC Example // Prepare the data $category_id = '15'; // using Zend XML-RPC method $result = $client->call('call', array($session_id, 'catalog_category.delete', array($category_id))); // returns true if delete was successful var_dump($result); Method: catalog_category.assignedProducts ($category_id, $store_view_code) Description: Returns a list of assigned products under the given category_id. Return: Array. Arguments: $category_id (required). Lists assigned products for this category_id. $store_view_code (required). Select Admin Panel, System, Manage Stores; select a store under the Store View Name, and you’ll find the code listed there. Sample Return Set array ( 0 => array ( 'product_id' => '2', 'type' => 'simple', 'set' => '4', 'sku' => 'SSS0003', 'position' => NULL, ), 1 => array ( 'product_id' => '10', 'type' => 'simple', 'set' => '4', 'sku' => 'SSS0004', 'position' => NULL, ), )
Image of page 260

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

APPENDIX API REFERENCES 239 SOAP Example // view assigned products for this category_id $category_id = '9'; $store_view_code = 'dollarstore'; // using SOAP method $results = $client->call($session_id, 'catalog_category.assignedProducts', array($category_id, $store_view_code)); // view results var_dump($results); Note Because we had multiple stores, we had to pass the $store_view_code to avoid getting empty arrays.
Image of page 261
Image of page 262
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern