Associate products to all websites more performant

Recently I had to associate all products of a shop to newly created websites in a setup shell script (Associate products to all websites).

This could have been implemented like that:

A much better approach was it to use class Mage_Catalog_Model_Product_Action like that:

This was much more performant, than saving each product all the time.

By the way: The class Mage_Catalog_Model_Product_Action is really worth a glimpse., because it is really useful to update product attributes too!

Leave a Reply

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


This site uses Akismet to reduce spam. Learn how your comment data is processed.