This is in relation to my question; how-to-get-a-products-file-attachments
I'd like to make a script (not on the server) that can utilize the Intellimage_Attachs
module in my other question.
I am going to use Magento SOAP if possible.
The problem I'm having at the moment is I can't get/put/update/w.e the product "samples/files".
return $this->handle->call($this->session,'product_custom_option.list', "productnamehere ");
Brings back a blank array on a product I have attachments on :(! Obviously using the wrong soap call, which one would be the correct one?
(as in product_custom_option.list
is incorrect, my function works fine with other calls.)
UPDATE
tried:
return $this->handle->call($this->session, 'product_downloadable_link.list', array( $sku . " "));
But won't work as the products are not downloadable products, even though they use samples
.
Best Answer
In your case you need to implement custom SOAP API endpoint. Luckily you may heavily reuse Downloadable Product API implementation.
If you create all files listed below, you will have new SOAP V2 API available: catalogProductAttachLinkList. To enable add/remove methods, just port them from app/code/core/Mage/Downloadable/Model/Link/Api.php to app/code/community/Intellimage/Attachs/Model/Link/Api.php.
To test new API run one of the following:
Files to be added to your module:
app/code/community/Intellimage/Attachs/etc/api.xml
app/code/community/Intellimage/Attachs/etc/wsdl.xml (Please note, that wsi.xml should be created if SOAP V2 WS-I compatibility is necessary)
app/code/community/Intellimage/Attachs/Model/Link/Api/V2.php
app/code/community/Intellimage/Attachs/Model/Link/Api.php