質問

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帰属
所属していません magento.stackexchange
scroll top