cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP API v1 - Adding custom options to new product

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

SOAP API v1 - Adding custom options to new product

Hi All!

 

I am trying to add a new product with a dropdown custom option via the SOAP API.

 

My script adds the product perfectly fine, but doesn't add the custom option. It doesn't provide me with any sort of error code or feedback to debug.

 

My code is as follows:

 

$fabric_options = array(
    array(
        "title" => "Please select your fabric grade",
        "type" => "drop_down",
        "is_require" => 1,
        "sort_order" => 1,
        "additional_fields" => array(
            array(
                "title" => "Grade #1",
                "price" => '0.00',
                "price_type" => "fixed",
                "sku" => '',
                "sort_order" => 0
            )
        )
    )
);

if(is_array($fabric_options)) {
    foreach($fabric_options as $option) {
        $options_action = $client->call( $session, 'product_custom_option.add', array($product_action, $option) );
        var_dump($options_action);
    }
}

 

Has anybody come across this before and knows how to fix it? 

Thanks!

1 REPLY 1

Re: SOAP API v1 - Adding custom options to new product

Fixed it! Cat Very Happy