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

Also this feature fails in 130 fixes can be found here

Info icon This preview shows pages 261–264. Sign up to view the full content.

Also, this feature fails in 1.3.0. Fixes can be found here: 38307/ . Method: catalog_category.assignProduct ($category_id, $product_id, $position) Description: Assigns a product under the given category_id. Return: Boolean; true if update was successful. Arguments: $category_id (required). The product will be assigned to this category_id. $product_id (required). You can input the product_id or SKU number of the product. $position (optional). Sets the position within the category. Zend XML-RPC Example // Prepare the data $category_id = '15'; $product_id = 'SSS0004'; // using Zend XML-RPC method $result = $client->call('call', array($session_id, 'catalog_category.assignProduct', array($category_id, $product_id))); // returns true if successful var_dump($result); Note If you run into problems after assigning products through the API, please see this thread for rebuilding the flat catalog product: .
Image of page 261

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

APPENDIX API REFERENCES 240 Method: catalog_category.updateProduct ($category_id, $product_id, $position) Description: Updates a product to the given category_id. Return: Boolean; true if update was successful. Arguments: $category_id (required). The product will be assigned to this category_id. $product_id (required). You can input the product_id or SKU number of the product. $position (optional). Sets the position within the category. Zend XML-RPC Example // Prepare the data $category_id = '11'; $product_id = 'SSS0004'; // using Zend XML-RPC method $result = $client->call('call', array($session_id, 'catalog_category.updateProduct', array($category_id, $product_id))); // returns true if successful var_dump($result); Method: catalog_category.removeProduct ($category_id, $product_id) Description: Removes a product to the given category_id. Return: Boolean; true if remove was successful. Arguments: $category_id (required). The product will be removed from this category_id. $product_id (required). You can input the product_id or SKU number of the product. Zend XML-RPC Example // Prepare the data $category_id = '11'; $product_id = 'SSS0004'; // using Zend XML-RPC method $result = $client->call('call', array($session_id, 'catalog_category.removeProduct', array($category_id, $product_id))); // returns true if successful var_dump($result);
Image of page 262
APPENDIX API REFERENCES 241 Category Attribute Set The category attribute set allows you to pull options and attributes assigned for all categories: catalog_category_attribute.currentStore catalog_category_attribute.list catalog_category_attribute.options Method: catalog_category_attribute.currentStore ($store_view_code) Description: Gets the store_id. Return: Int, the store_id. Argument: $store_view_code (optional). Select Admin Panel, System, Manage Stores; select a store under the Store View Name, and you’ll find the code listed there. SOAP Example // Set the store code $store_view_code = 'dollarstore'; // using SOAP method $result = $client->call($session_id, 'catalog_category_attribute.currentStore', $store_view_code); // returns the store_id echo $result; Method: catalog_category_attribute.list () Description: Gets a list of category attributes Return: Array.
Image of page 263

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

Image of page 264
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