m openmage

OpenMage LTS Developer Documentation

Product Custom Option List

Edit this page on GitHub

Module: Complex Product API

Resource: product_custom_option

Method:

Allows you to retrieve the list of custom options for a specific product.

Arguments:

Type Name Description
string sessionId
Session ID
string
productId Product ID
string store Store view ID or code (optional but required for WS-I mode)

Return:

Type Name Description
array result Array of catalogProductCustomOptionList

The catalogProductCustomOptionList content is as follows:

Type Name Description
string option_id Custom option ID
string
title
Custom option title
string
type
Custom option type
string
sort_order
Custom option sort order
int is_require
Defines whether the custom option is required

Faults:

Fault Code Fault Message
101 Product with requested id does not exist.
104 Store with requested code/id does not exist.

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, 'product_custom_option.list', '1');
var_dump($result);

// If you don't need the session anymore
//$client->endSession($session);
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->catalogProductCustomOptionList($sessionId, '1');
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->catalogProductCustomOptionList((object)array('sessionId' => $sessionId->result, 'productId' => '1', 'store' => '1'));
var_dump($result->result);
Response Example SOAP V1
array
  0 =>
    array
      'option_id' => string '1' (length=1)
      'title' => string 'model' (length=5)
      'type' => string 'drop_down' (length=9)
      'is_require' => string '1' (length=1)
      'sort_order' => string '0' (length=1)