0

hey guys i am triying to save products in magento by getting from xml.But i couldnt find good way to update prices and qty fast.tried to :

  public function productUpdate($productSkus = array(), $data = array(), $storeId = 1) {
        $ids = Mage::getModel('catalog/product')
                ->getCollection()
                ->addAttributeToFilter('sku', $productSkus)
                ->getAllIds();

        Mage::getSingleton('catalog/product_action')->updateAttributes(
                $ids, $data, $storeId
        );
    }

but not good enough and it gives me an error while updatting qty.It is not differen from $product->save(); I need fast way to upgrade this 2 attribute.Guys pls help.I am really bad situation in my company about my posiition. Thank you.

sj_magento
  • 121
  • 1
  • 5
  • Please check this link : http://stackoverflow.com/questions/7599576/update-products-programmatically-in-magento – Rabea Oct 22 '15 at 13:19
  • he use two model calling.How can it be fast ? i have 9000 products in my xml and the xml document is always changing. – sj_magento Oct 22 '15 at 13:27
  • You only need the part for stock inventory update, if you have noticed; that the first one is to check that the product exists, and to get the price+name for it , which is something you DON'T need – Rabea Oct 22 '15 at 13:29
  • but i need to set price which is the first part.So in this case i need both part if we cant save price via stockItem ?? – sj_magento Oct 22 '15 at 13:38

1 Answers1

0

Did you have a look at this extension? This extension enables you to map the fields accordingly and with ease you will be able to import all the required information as well as update the existing ones. Its not the cheapest but definitely worth it long term.

Auto Product Import with XML and Webservice

pasujemito
  • 312
  • 4
  • 16