$attributeData = array('Visibility'=>Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
$product = Mage::getModel('catalog/product')->load($productId);
$storeIds = $product->getStoreIds();foreach($storeIds as $storeId){
Mage::getSingleton('catalog/product_action')->updateAttributes(array($productId), $attributeData, $storeId);
}
注意:storeId为store的id号,如果需要更新默认值(default value),可以将storeid设置为0.
本文详细介绍了如何使用Magento框架实现产品属性的批量更新,包括如何针对不同商店ID进行操作,以及如何处理默认属性更新。

被折叠的 条评论
为什么被折叠?



