header

Magento 1.x Software Support Notice

For Magento Commerce 1, Magento is providing software support through June 2020. Depending on your Magento Commerce 1 version, software support may include both quality fixes and security patches. Please review our Magento Software Lifecycle Policy to see how your version of Magento Commerce 1 is supported.

For Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Product List

Mage_Checkout

Module: Shopping Cart API

Resource: cart_product

Method:

Allows you to retrieve the list of products in the shopping cart (quote).

Arguments:

Type Name Description
string sessionId Session ID
int quoteId Shopping cart ID
string store Store view ID or code (optional)

Return:

Type Name Description
array result Array of shoppingCartProductResponseEntity

The shoppingCartProductResponseEntity (catalogProductEntity) content is as follows:

Type Name Description
string product_id Product ID
string
sku
Product SKU
string
name
Product name
string
set
Product attribute set
string
type
Product type
ArrayOfString
category_ids
Array of category IDs
ArrayOfString
website_ids
Array of website IDs

Faults:

Examples

Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'cart_product.list', '15');
var_dump ($result);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->shoppingCartProductList($sessionId, '15');
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey')); 
 
$result = $proxy->shoppingCartProductList((object)array('sessionId' => $sessionId->result, 'quoteId' => 15));   
var_dump($result->result);
Response Example SOAP V1
array
  0 =>
    array
      'product_id' => string '3' (length=1)
      'sku' => string 'canonxt' (length=7)
      'name' => string 'Canon Digital Rebel XT 8MP Digital SLR Camera' (length=45)
      'set' => string '4' (length=1)
      'type' => string 'simple' (length=6)
      'category_ids' =>
        array
          0 => string '5' (length=1)
      'website_ids' =>
        array
          0 => string '2' (length=1)