Magento2 – Attribute Not Shown in Layer Navigation After Migration

attributeslayered-navigationmagento2product-attribute

I migrated from Magento 1.9.3.3 to Magento 2.1.7 EE. I have one issue, that is some of the attributes(multiple select) not shown in layer navigation.

Create new category called test,
Assign two products to test category, that two products have multiple select attributes.

Multiple select attribute have the below propertiesenter image description here

but it is not rendering in layer navigation.

If anyone faces this issue before, please post the solution.

Note: Migrated attributes only have this issues, If I create a new attribute with similar fashion, it works!

Best Answer

The steps to resolve this issue after migrating is first to open the attribute and save it again, this will set the type from text to varchar. After this run the SQL below to copy all data from the text to the varchar table.

INSERT INTO catalog_product_entity_varchar
(store_id, attribute_id, entity_id, value)
    SELECT store_id, attribute_id, entity_id, value
    FROM catalog_product_entity_text
    WHERE catalog_product_entity_text.attribute_id = {your attribute id}
    AND catalog_product_entity_text.value is not null;

Now delete the data from the text table

DELETE FROM `catalog_product_entity_text`
WHERE `attribute_id` = {your attribute id}

Run in terminal

  • php magento2/bin/magento indexer:reindex
  • php magento2/bin/magento cache:flush

If the reindex is giving a duplication error, search for the entity_id in the catalog_product_entity_varchar table and check if there is a duplicate value for the attribute id in the field.

Related Topic