2013-05-14 78 views
2

没有显示我有被设置为Filterable (with results)Use In Layered Navigation的属性。我重新编制索引,清除了缓存,甚至关闭了平板电脑,但我无法将它显示在滤镜上。可筛选属性在过滤器

我在catalog_product_index_eav表中的所有其它过滤属性ID都在那里找到了,但我的丢失。

我已经找到了在Mage_Catalog_Model_Layer_Filter_Attribute::_getItemsData()此查询,检查,看看有多少产品有一个给定的属性。如果它是空的,它并不显示属性

SELECT 
    `warehousecheckout_warehouses_idx`.`value`, 
    COUNT(warehousecheckout_warehouses_idx.entity_id) AS `count` 
FROM `catalog_product_flat_11` AS `e` 
INNER JOIN `catalog_category_product_index` AS `cat_index` 
    ON cat_index.product_id=e.entity_id 
    AND cat_index.store_id=11 
    AND cat_index.visibility IN(2, 4) 
    AND cat_index.category_id='11' 
INNER JOIN `catalog_product_index_price` AS `price_index` 
    ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' 
    AND price_index.customer_group_id = 0 
INNER JOIN `catalog_product_index_eav` AS `warehousecheckout_warehouses_idx` 
    ON warehousecheckout_warehouses_idx.entity_id = e.entity_id 
    AND warehousecheckout_warehouses_idx.attribute_id = '198' -- attr id i want to filter by 
    AND warehousecheckout_warehouses_idx.store_id = '11' 
GROUP BY `warehousecheckout_warehouses_idx`.`value`; 

但也有attribute_id = '198'没有行,所以属性永远不会显示。为什么这个属性没有被索引?它是通过安装脚本创建的,而不是通过管理员创建的,所以有可能在某处丢失了某个值。

+0

您是否设置了 - * category-> display setting->是否将锚点设置为“Yes”* – aforankur 2013-05-14 05:53:43

+0

@Anx它不是一个类别。这是一个属性。 – 2013-05-14 17:16:28

回答

1

没有直接的答案。 转到方法:

删除其他条件并激发此查询,并检查是否得到您的结果,然后添加一个条件并继续,直到找到导致需要的行被删除的条件。

我看到的是: warehousecheckout_warehouses_idx.entity_id = e.entity_id AND warehousecheckout_warehouses_idx.attribute_id = '198' - ATTR ID我想 AND warehousecheckout_warehouses_idx.store_id = '11'过滤

也 AND cat_index.category_id = '11'

有几个,但 无论是类别Id或商店ID应该是原因。

+0

任何商店的idx表中都不存在198值。 – 2013-05-14 17:16:52

0

我可以手动创建的EAV表中的条目与

insert into catalog_product_index_eav 
select entity_id, attribute_id, 1, value 
from catalog_product_entity_varchar 
where attribute_id = 198; 

insert into catalog_product_index_eav_idx 
select entity_id, attribute_id, 1, value 
from catalog_product_entity_varchar 
where attribute_id = 198; 

你将不得不为每个商店视图做到这一点。