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

Adding Product Attributes to Productlisting
 
ncn
Jr. Member
 
Total Posts:  3
Joined:  2008-03-06
Germany
 

Hello,

iam working an a magento-based project. I am currently customizing the Product listenings. But i dont find a way to put the attribute XY of a product to the listing.  I´d like to do that without customizing any core-code - just using the templates. Can somebody help me?

best regards

Hendrik

(I´am from Germany - Sorry for my bad englisch grin)

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

in backend you created that new attribute for your attribute set? You can define new attributes in backend. You can find Template for listing here

frontend/default/default/template/catalog/product/list.phtml

For example you can print attribute called processor in backend by typing:

<? $_product->getProcessor(); ?>

or attribute shoe_type (from demo data of magento)

<? $_product->getShoeType(); ?>

Hope iam right and understood your need, also from germany with bad english smile

Cheers

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
ncn
Jr. Member
 
Total Posts:  3
Joined:  2008-03-06
Germany
 

Thanks for your answer. Actually it currently didnt work for me. The systemattributes (like costs etc) shows me a result, but the attributes i added didnt get any output. or is it not possible to read Dropdown Attributes?

Maybe its too late and i only misstipped or something - so i will work on it and report my results here.

Hendrik

 
Magento Community Magento Community
Magento Community
Magento Community
 
Daim
Sr. Member
 
Total Posts:  172
Joined:  2008-01-08
Germany
 

You have only a Example for the normal Catalog View
Edit in this file /app/design/frontend/default/default/layout/catalog.xml

<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">
                    <
action method="addAttribute"><attribute>manufacturer</attribute></action>
....
                </
block>
            </
block>
        </
reference>
    </
catalog_category_default>

    <
catalog_category_layered>
        <
reference name="left">
            <
block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.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">
                    <
action method="addAttribute"><attribute>manufacturer</attribute></action>
....
                </
block>
            </
block>
        </
reference>
    </
catalog_category_layered>

And the in the Produlctlist View you must add

<td class=\"data\">".$_product->getResource()->getAttribute('Manufacturer')->getSource()->getOptionText($_product->getManufacturer())."</td>

or 

<
td class=\"data\">".$_product->getManufacturer()."</td>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top