Magento Forum

   
How do I update a product by code without using webservices api? 
 
paolos1979
Jr. Member
 
Total Posts:  5
Joined:  2009-03-10
 

I have to update daily a large amount of data and web services api it is too slow.

I am trying somthing like this:

$product = Mage::getModel(’catalog/product’)->loadByAttribute(’sku’,"XXXXX");
$product->setDescription(’my description’);
$product->save();

but I got an error like this:

Warning: Invalid argument supplied for foreach() in /var/www/mysite/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 937’

Is there eomething similar?

or is ther a way to call directly the method of the webservices api without using webservices?

Thank you
Paolo

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adjustware
Guru
 
Avatar
Total Posts:  654
Joined:  2009-05-11
 

As an option you can create a simple script that updates products descriptions directly in the database. Once the update is made, refresh search index if needed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
paolos1979
Jr. Member
 
Total Posts:  5
Joined:  2009-03-10
 

Yea, ok i tought ther was a way to do it without using sql, but I ca n do that,
thank you very much
Paolo

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top