/ Published in: PHP

Create a CSV with a maximum of 1 column, with just the Magento category ID.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php require_once MAGENTO . '/app/Mage.php'; Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); foreach ($cats as $cat) { $newcats[$cat] = true; } } // Activate the categories it is in foreach ($newcats as $cat=>$value) { try { $_category = Mage::getModel('catalog/category')->load($cat); if ($_category->getIsActive() === "0" || !$_category->getIsActive()) { $_category->setIsActive(1); $_category->save(); echo "<br />Enabled ".$_category->getName(); } } catch(Exception $e) { echo " Caught Cat Insert exception: ", $e->getMessage(); } } } ?>
Comments
