0

I have created a product's attribute select type (dropdown) source model of this attribute from custom table.

Everything is fine but when I set this display in layered navigation, It's not showing in layered navigation and also breaks other attribute display.

Following is my attribute creation script:

$eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
    'user',
    [
        'type' => 'int',
        'backend' => '',
        'frontend' => '',
        'label' => 'Users',
        'input' => 'select',
        'class' => '',
        'source' => 'Vendor\Module\Model\Product\Attribute\Source\Users',
        'global' => 1,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'default' => null,
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => false,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => '',
        'system' => 0,
        'group' => 'General',
        'option' => ''
    ]
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.