2015-01-08 81 views
1

有什么方法可以在导航菜单中添加缩略图吗? Magento 1.9.1.0在Magento管理面板中删除此功能。你有什么建议吗?Magento 1.9.1.0在类别菜单中没有缩略图

感谢,

+0

只是样本数据和安装然后截断产品,类别,订单和属性表。通过此数据删除和缩略图字段保持可见。这是一种方法,如果你得到另一个请让我们知道。我也有同样的错误 – Shin

+0

嗨Shijin,你是什么意思只是安装一个示例数据?我是否需要使用产品填充我的网站?那么类别中的缩略图将显示?让我知道。谢谢, –

+0

我发布了一个答案,我会尝试,请检查一下,但请注意attribute_id – Shin

回答

0

我通过我的phpMyAdmin的运行下面的查询解决此问题,

1)

INSERT INTO `eav_attribute` (`attribute_id`, `entity_type_id`, `attribute_code`, 
`attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, 
`frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_required`, 
`is_user_defined`, `default_value`, `is_unique`, `note`) VALUES(140, 3, 'thumbnail', NULL, 
'catalog/category_attribute_backend_image', 'varchar', NULL, NULL, 'image', 'Thumbnail 
Image', NULL, NULL, 0, 0, NULL, 0, NULL); 

2)

INSERT INTO `catalog_eav_attribute` (`attribute_id`, `frontend_input_renderer`, 
`is_global`, `is_visible`, `is_searchable`, `is_filterable`, `is_comparable`, 
`is_visible_on_front`, `is_html_allowed_on_front`, `is_used_for_price_rules`, 
`is_filterable_in_search`, `used_in_product_listing`, `used_for_sort_by`, 
`is_configurable`, `apply_to`, `is_visible_in_advanced_search`, `position`, 
`is_wysiwyg_enabled`, `is_used_for_promo_rules`) VALUES 
(140, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, NULL, 0, 0, 0, 0); 

3)

INSERT INTO `eav_entity_attribute` (`entity_attribute_id`, `entity_type_id`, 
`attribute_set_id`, `attribute_group_id`, `attribute_id`, `sort_order`) 
VALUES (337, 3, 3, 4, 140, 3); 

我在这里使用attribute_id为140,使用这这些查询的ID通过独特的价值

显示在前端这张图片,我们可以使用

<?php $thumbnail = $_category->getThumbnail(); ?> 
    <?php if($thumbnail): ?> 

    <img src ="<?php echo Mage::getBaseUrl('media').'catalog' . DS . 'category' . DS.$thumbnail; ?>" alt="<?php echo $this->escapeHtml($_category->getName()) ?>" class="img-responsive" />  

    <?php endif; ?> 
+0

即使在运行SQL之后,看起来我们不能再用'getThumbnail()'调用类别缩略图了吗? – zigojacko

+0

我解决了我的错误vaia使用此查询 – Shin

+0

所有这些查询做的是创建属性,将其添加到数据库,然后确保它们都链接起来。你如何在前端显示类别缩略图? – zigojacko

相关问题