views:

60

answers:

0

I need to know how to set the downloadable URL for a downloadable new product created using Magento API. Problem is find the appropriate array value for the downloadable URL. here is my code:

$productData = array(
'name'              => $stealth_item->Title,
'websites'          => array(1),
'short_description' => ltrim( ereg_replace( "\n", "", $stealth_item->Abstract ) ),
'description'       => ltrim( ereg_replace( "\n", "", $stealth_item->Abstract ) ),
'price'             => $stealth_item->Price,
'status'  => 1,
'tax_class_id' => 2,
'meta_title' => $stealth_item->Title,
'meta_description' => ltrim( ereg_replace( "\n", "", $stealth_item->Abstract ) ),
'type_id'  => 'downloadable'
);

$magento->call( $sessionId, 'product.create', array( 'simple', $set['set_id'], $stealth_item->ISBN, $productData) );

This code creates a downloadable product but now I don't know how to fill it with the download url (Sample and File links)