【问题标题】:Magento admin is only showing 2 custom attributes on product admin page, new attributes I've created don't displayMagento 管理员仅在产品管理页面上显示 2 个自定义属性,我创建的新属性不显示
【发布时间】:2022-11-11 19:23:21
【问题描述】:

几个月前,当我第一次开始设置这个 Magento 2 站点时,我在 Magento Admin 中创建了自定义产品属性“尺寸”和“样式”——一切正常,每当我设置任何产品时,尺寸和样式的下拉菜单都会显示在目录/产品的属性部分。

现在,我在 Magento Admin 中创建了另外三个要使用的自定义属性,并且我已经按照与原来的两个完全相同的方式配置了它们。但是,这些新属性的下拉菜单不会显示在目录/产品的属性部分。

我已刷新 Magento 缓存并重新索引但没有成功。 Magento 是否只允许产品的 2 个自定义属性,还是我只是遗漏了什么?

【问题讨论】:

    标签: magento attributes product admin


    【解决方案1】:

    您是使用模块通过代码创建自定义属性还是使用 Magento Admin 创建自定义属性?

    对于 Magento 管理员,请分享步骤。

    请分享您为创建属性而编写的整个代码。请确认遵循正确的步骤:

    下面的代码用于创建自定义下拉属性。

     /* Product Custom Multi Select Option */
            $eavSetup->removeAttribute(MagentoCatalogModelProduct::ENTITY, 'custom_cms_pages');
            $eavSetup->addAttribute(
                MagentoCatalogModelProduct::ENTITY,
                'custom_cms_pages',
                [
                    'type' => 'varchar',
                    'label' => 'Custom CMS Pages',
                    'input' => 'multiselect',
                    'required' => false,
                    'sort_order' => 30,
                    'source' => VendoreNameModuleNameModelConfigSourceCMSPageList::class,
                    'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_STORE,
                    'backend' => 'MagentoEavModelEntityAttributeBackendArrayBackend',
                    'group' => 'custom_content_hide',
                ]
            );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多