0

Thats one my attributes that should be visible in layered navigation:

 $eavSetup->removeAttribute(Product::ENTITY, 'supported_software'); $eavSetup->addAttribute( Product::ENTITY, 'supported_software', [ 'type' => 'text', 'input' => 'multiselect', 'frontend_class' => 'required-entry', 'label' => 'Supported software', 'group' => 'Technical parameters', 'sort_order' => 190, 'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend', 'frontend' => '', 'source' => '[vendor]\DbSchema\Model\SupportedSoftware\Adminhtml\Source\SupportedSoftware', 'default' => 10, 'is_wysiwyg_enabled' => false, 'is_html_allowed_on_front' => false, 'used_for_sort_by' => false, 'global' => ScopedAttributeInterface::SCOPE_GLOBAL, 'visible' => true, 'required' => true, 'user_defined' => true, 'searchable' => false, 'visible_in_advanced_search' => false, 'search_weight' => '', 'filterable' => true, 'filterable_in_search' => true, 'comparable' => true, 'visible_on_front' => true, 'used_in_product_listing' => true, 'unique' => false, 'apply_to' => 'downloadable,bundle', 'is_used_for_promo_rules' => true, 'is_used_in_grid' => false, 'is_visible_in_grid' => false, 'is_filterable_in_grid' => false, 'is_required_in_admin_store' => '', 'system' => 0, ] ); 

Moreover this attribute has digit values for admin store and varchar values for frontend (default store view). But I don't think it is the problem here. Layered navigation appears on frontend properly. I have in db about 40 products added programatically (tests) and all of them should have some values of this attribute (I am adding these values for admin - but for frontend are being added simultanously). Sometimes my attributes shows up in layered navigation but sometimes not. If I add product from adminhtml manually values its values appears in layered navigation, but they erase former values. For example - if I have 10 product with values x and 10 with values y and I add product with value z in layered navigation after reindex/cache flush only appears results for only one product with value z.

All of my categories are anchored.

EDIT: Some attributes - escpecially the ones which have source model Yes/No in fact appear in lay nav in correct way and also react on changes of values of attributes properly.

EDIT: The same attribute if I added source model instead of options still doesn't appear in lay nav.

2
  • Is data loaded for layered navigation being saved in db somewhere or it's rather cached or what? Commented Jul 5, 2016 at 10:30
  • We had a similar issue some time ago. We would suggest you to check the eav_attribute and catalog_eav_attribute tables and compare "regular" Magento attributes with the attributes you have created programmatically. There can be a difference that gives you such results. Commented Jul 13, 2016 at 13:36

1 Answer 1

0

I wonder if being searchable is not a requirement if you want the attribute to be filterable.

What engine are you using ?

3
  • engine? I use Magento 2.1 and php 7.0 Commented Jul 14, 2016 at 8:23
  • I mean what search engine MySQL, SolR, ES ? Is the missing attribute searchable ? Commented Jul 14, 2016 at 11:07
  • I was testing it with many setting, also searchable but in my opinion it doesn't matter. Commented Jul 14, 2016 at 11:16

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.