Magento Update Script

To Update massive amounts of data in magento without going directly into the database I found an interesting piece of code under http://www.mydons.com/writing-custom-magento-shell-script/:

I adopted this file to simply print the sku of all products in the shop and count them:

These two examples show how to iterate over all products and how to get a specific product by sku. They have to be placed in ${magento_root}/shell

To speed up updates a bit magento provides the ability to update single fields instead of the whole product as in code snippet one:

Of course the fastest way is to write SQL queries. Therefor please read into the magento EAV model.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.