I would like to edit a downloadable product by php. Specifically I would like to change/add the file url that would be used by the system to access the file to be purchased e.g. http://somewhere/song.mp3. I looked at an example online and this seems to be fairly simple for samples(this is not my code):
$sampleModel = Mage::getModel('downloadable/sample')->setData(array( 'product_id' => $product->getId(), 'sort_order' => 0, 'sample_url' => '/u/n/untitled_1.png', 'sample_file' => '', 'sample_type' => 'file', 'title' =>'mYtitle' )); $sampleModel->save();
I don't know how to do this for the link url. And Where do I place the script. Thanks.