小编Sco*_*t S的帖子

我可以使用magento中的属性脚本设置默认商店视图标签

我正在使用模块在客户模型上创建新属性.有谁知道如何使用我的设置脚本设置默认商店视图?

管理员截图

我目前的剧本:

$setup = new Mage_Customer_Model_Resource_Setup('customer_setup');

if (! $setup->getAttribute('customer', 'dob_month')) {
    $setup->addAttribute('customer', 'dob_month', array(
        'label'     => 'Month',
        'type'      => 'varchar',
        'input'     => 'select',
        'source'    => 'eav/entity_attribute_source_table',
        'required'  => true,
        'position'  => 1,
        'option'    => array (
            'values' => array (
                'January',
                'February',
                'March',
                'April',
                'May',
                'June',
                'July',
                'August',
                'September',
                'October',
                'November',
                'December'
            )
        )
    ));
}
Run Code Online (Sandbox Code Playgroud)

php magento entity-attribute-value

4
推荐指数
1
解决办法
2457
查看次数

将源模型添加到magento中的属性

我创建了一个安装脚本,使用下面的脚本向客户添加两个字段.

但是我得到了这个错误.

Source model "" not found for attribute "dob_month"
Run Code Online (Sandbox Code Playgroud)

我没有在第一行定义模型吗?这究竟是做什么的?解决这个问题的最佳方法是什么?

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');


$setup->addAttribute('customer', 'dob_month', array(
    'label'     => 'Month',
    'type'      => 'varchar',
    'input'     => 'dropdown',
    'visible'   => true,
    'required'  => true,
    'position'  => 1,
    'option'    => array (
        'value' => array (
            'optionone'    => array('January'),
            'optiontwo'    => array('February'),
            'optionthree'  => array('March'),
            'optionfour'   => array('April'),
            'optionfive'   => array('May'),
            'optionsix'    => array('June'),
            'optionseven'  => array('July'),
            'optioneight'  => array('August'),
            'optionnine'   => array('September'),
            'optionten'    => array('October'),
            'optioneleven' => array('November'),
            'optiontwelve' => array('December') …
Run Code Online (Sandbox Code Playgroud)

php magento

1
推荐指数
1
解决办法
7839
查看次数

magento adminhtml xml中"Allow Everything"究竟做了什么?

任何人都可以告诉我下面的xml的标题节点实际上是什么?我很难找到相关信息.

<config>
<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <tag_manager translate="title" module="googletagmanager">
                                    <title>Google Tag Manager</title>
                                    <sort_order>0</sort_order>
                                </tag_manager>
                            </children>
                        </config>
                    </children>
                </system>
            </children>
        </admin>
    </resources>
</acl>
Run Code Online (Sandbox Code Playgroud)

xml magento

1
推荐指数
1
解决办法
293
查看次数

标签 统计

magento ×3

php ×2

entity-attribute-value ×1

xml ×1