0
我已經在Magento 2.1添加了自定義的產品屬性和產品顯示屬性部分,但不能在我們創建產品自定義的產品屬性不管理目錄部分Magento的顯示2.1
Magento的目錄部分顯示以下是我用來創建屬性的代碼。
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
/**
* Add attributes to the eav/attribute
*/
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'test_author',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Test Author',
'input' => '',
'class' => '',
'source' => '',
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => ''
]
);
在Magento 2.1,你需要添加ui_component顯示在目錄形式段自定義屬性 –