How to get access to custom Image Attribute in list.phtml in Magento

前端 未结 1 1912
余生分开走
余生分开走 2021-01-25 20:35

I am creating a website in magento.

So i have added a new media image attribute to my products. I want to use a specific image for my homepage but a few products will no

相关标签:
1条回答
  • 2021-01-25 21:27

    Take a look @ Magento - add media gallery attribute to product flat table

    Open app/design/frontend/default/yourtheme/layout/catalog.xml

    In <catalog_category_layered translate="label"> and <catalog_category_default translate="label"> find the line below

     <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
     <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
     <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
    

    and (add <action method="addAttribute">....)

    <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
    <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
    add -->   <action method="addAttribute"><name>MaleFemaleImage</name></action>
    <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
    

    Read more @

    • How to add attributes to product grid or list view in category in Magento Commerce

    • How to add attributes to product grid in category

    0 讨论(0)
提交回复
热议问题