0

I have about a dozen categories with hundreds of subcategories each, and I need to set the "Use Parent Category Settings" option under Custom Design to Yes on all the subcategories.

I tried what was explained here but it doesn't work with this particular setting as there is no database entry in the catalog_category_entity_int table for categories in which this setting hasn't been modified, in other words, only if I manually set the option to Yes, then an entry is created in the DB table above.

So, is there any other way to bulk edit this option for all subcategories?

Thanks!

0

I ended modifying and using this script, worked perfectly:

<?php

define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
umask(0);

$currentStore = Mage::app()->getStore()->getId();
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);

$category = Mage::getModel('catalog/category');
$tree     = $category->getTreeModel();
$tree->load();
$ids = $tree->getCollection()->getAllIds();

foreach ($ids as $_id){
       $_category = Mage::getModel('catalog/category')->load($_id);
       $_category->setCustomUseParentSettings(true);
       $_category->save();
       echo "Done " . $_id . "\n";
    }

// set the store scope back
Mage::app()->getStore()->setId($currentStore);

?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.