Monday, May 17, 2010

Import products update

This is an update for http://marius-strajeru.blogspot.com/2009/11/import-simple-products-for-barrmy.html

Starting version 1.4 you can only perform product updates 'programmatic' only if Magento thinks you are in the admin panel.

If you try to do this from a non-admin page make sure you put this

Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
before you call
$product->save();

2 comments:

  1. This works for Magento 1.7.0.2?

    thank you

    ReplyDelete
    Replies
    1. I didn't test it on 1.7.0.2. (the post is more than 2 years old) but it should work.
      You can test it and post a comment here if it does or doesn't.

      Delete