Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Display new attribite on list.phtml
 
prits
Jr. Member
 
Total Posts:  28
Joined:  2008-06-27
 

Hello,

I have created a new attribute from admin section named “Range” of varchar type.  I want to display at frontend on product listing/grid page.

My attribute labeled “Range” and internally treated as “range”.

I followed http://www.magentocommerce.com/wiki/how-to/add-attributes-to-product-grid but it is not displaying anything.

Seeking for help....

 
Magento Community Magento Community
Magento Community
Magento Community
 
optick
Member
 
Avatar
Total Posts:  34
Joined:  2008-07-20
Brasov, Romania
 

you can do something like this:

in app\design\frontend\default\default\layout\catalog.xml

replace <catalog_category_default> section with this

<catalog_category_default>
        <
reference name="left">
            <
block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </
reference>
        <
reference name="content">
            <
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">

                    <
action method="addAttribute"><attribute>range</attribute></action>    <!-- here add your attribute -->

                    <
block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    </
block>
                    <
action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </
block>
            </
block>
        </
reference>
    </
catalog_category_default>

then in the app\design\frontend\default\default\template\catalog\product\list.phtml

after line <?php echo $this->getPriceHtml($_product, true) ?> (line 100) add code

<?php  echo $_product->getRange() ?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top