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

Sample return set array productid 12 sku sss123456

Info icon This preview shows pages 272–277. Sign up to view the full content.

Sample Return Set array ( 'product_id' => '12', 'sku' => 'SSS123456', 'set' => '4',
Image of page 272

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

APPENDIX API REFERENCES 251 'type' => 'simple', 'categories' => array ( ), 'websites' => array ( ), 'special_price' => '14.9900', 'special_from_date' => '2009-09-05 00:00:00', 'special_to_date' => NULL, ) Zend XML-RPC Example // Prepare the data $product_id = '12'; $results = $client->call('call', array($session_id, 'catalog_product.getSpecialPrice', array($product_id))); // view the results var_dump($results); Method: catalog_product.delete ($product_id) Description: Deletes the product. Return: Boolean; true if delete was successful. Argument: $product_id (required). The product_id or product_sku to remove. SOAP Example // Prepare filters $product_id = '12'; // using SOAP method $results = $client->call($session_id, 'catalog_product.delete', $product_id); // returns true if delete was successful var_dump($results); Product Attribute Set The product attribute set allows you to pull options and attributes assigned for products: catalog_product_attribute.currentStore catalog_product_attribute.list catalog_product_attribute.options
Image of page 273
APPENDIX API REFERENCES 252 Method: catalog_product_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_product_attribute.currentStore', $store_view_code); // returns the store_id echo $result; Method: catalog_product_attribute.list ($attribute_set_id) Description: Returns a list of product attributes given the attribute_set_id. Return: Array. Argument: $attribute_set_id (required). This can be obtained through the catalog_product_attribute_set.list() API. Sample Return Set array ( 0 => array ( 'attribute_id' => '56', 'code' => 'name', 'type' => 'text', 'required' => '1', 'scope' => 'store', ), 1 => array ( 'attribute_id' => '57', 'code' => 'description', 'type' => 'textarea', 'required' => '0', 'scope' => 'store', ), 2 => array ( 'attribute_id' => '58',
Image of page 274

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

APPENDIX API REFERENCES 253 'code' => 'short_description', 'type' => 'textarea', 'required' => '1', 'scope' => 'store', ), Zend XML-RPC Example // Prepare the data $attribute_set_id = '4'; $results = $client->call('call', array($session_id, 'catalog_product_attribute.list', array($attribute_set_id))); // view the results var_dump($results); Method: catalog_product_attribute.options ($attribute_id, $store_view_code) Description: Returns a list of product attribute options. Return: Array Arguments: $attribute_id (required). The attribute_id or attribute_code to list options. $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. Sample Return Set array ( 0 => array ( 'value' => '', 'label' => '- Please Select --', ), 1 => array ( 'value' => 1, 'label' => 'Enabled', ), 2 => array ( 'value' => 2, 'label' => 'Disabled', ), ) SOAP Example // Prepare the data $attribute_id = 'status';
Image of page 275
APPENDIX API REFERENCES 254 // using SOAP method $result = $client->call($session_id, 'catalog_product_attribute.options', $attribute_id); // view the result var_dump($result); Product Attribute Set The product attribute set lists the sets available on your store: catalog_product_attribute_set.list
Image of page 276

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

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