I'm trying to set the default value as "Yes" for the Is Active field on New Category. The default value is no, and the store owner gets annoyed when the category doesn't show on the frontend. I've tried using function $attribute->getDataSetDefault('default_value',1); on app\code\core\Mage\Adminhtml\Block\Catalog\Category\Tabs.php, but it didn't work.

The div content on design/adminhtml/default/default/catalog/category/edit/form.phtml is generated dinamically on Tabs.php, on this call:

$block = $this->getLayout()->createBlock($this->getAttributeTabBlock(), '')
            ->setGroup($group)
            ->setAttributes($attributes)
            ->setAddHiddenFields($active)
            ->toHtml();

I tried to debug, but after a while I had an overflow on debug memory, and it crashed. I'm still trying this.

I also tried to look at configuration files to find where the attribute is created to see if a default value is set, but I haven't find it yet.

New Category Form

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top