Magento 1.9.1.0类别菜单中没有缩略图图像

时间:2015-01-08 03:24:34

标签: magento magento-1.9.1

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

谢谢,

1 个答案:

答案 0 :(得分: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; ?>   
相关问题