Closed willy-ahva closed 10 years ago
I'm tagging myself here so I can review this later and possibly do some cleanup/merging of the request.
Thanks for your contribution! :-)
You're welcome ! You can do what you want about this code ;)
Do you know if it's possible, in an api like AiImport, to use the same method than the "Check Data" button from the page where you can import a CSV file in Magento ? And if yes, what are those methods ? Thanks for help @danslo :)
@willy-ahva It's not currently possible, but should be easy to add.
This is how Magento does it: https://github.com/OpenMage/magento-mirror/blob/magento-1.8/app/code/core/Mage/ImportExport/Model/Import.php#L440
Basically all you need to do is add something like this to Danslo_ApiImport_Model_Import_Api
:
public function validateEntities($entities, $entityType = null, $behavior = null)
{
// Not sure if these are needed when validating.
$this->_setEntityTypeCode($entityType ? $entityType : Mage_Catalog_Model_Product::ENTITY);
$this->_setBehavior($behavior ? $behavior : Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE);
$this->_api->getDataSourceModel()->setEntities($entities);
return array($this->_api->isDataValid());
}
And then obviously update wsdl.xml
and api.xml
. Haven't tested the above, but it should work.
I'd love to see this PR merged I've done a (light) code review and it looks solid.
@drewdotpro I'm getting this merged pretty soon, I just want to make some slight adjustments but haven't gotten around to it unfortunately.
Here is a PR to : Add image support : now you can import image directly via Soap.
Enhance benchmark :