Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'app/Mage.php';
- Mage::app();
- $categoryId = '';
- $attributeCode = '';
- $attributeId = '';
- $products = Mage::getModel('catalog/category')->load($categoryId)->getProductCollection()->addAttributeToFilter($attributeCode, $attributeId);
- if($products->getSize() < 1) {
- echo "None products found.\n";
- exit(0);
- }
- Mage::register('isSecureArea', true);
- foreach($products as $product) {
- $product->load($product->getId());
- echo "{$product->getSku()} - {$product->getName()}\n";
- try {
- $product->setManufacturer(null)->save();
- } catch (Exception $e) {
- echo "ERROR: {$product->getSku()} | {$e->getMessage()} \n";
- }
- }
- Mage::unregister('isSecureArea');
Add Comment
Please, Sign In to add comment