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

Page 2 of 2
Custom Attributes in List? 
 
CQ Website Design
Sr. Member
 
Total Posts:  195
Joined:  2009-01-02
 

Thats odd still does not work when I create a new attribute called test with the value in the product = dummy :(

Would you like to have the admin info and ftp and see if you can sus it? It might have something to do with XML?

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

yeah sure. email details and ill look.

probably be sunday now. going to the pub to watch the football grin

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
CQ Website Design
Sr. Member
 
Total Posts:  195
Joined:  2009-01-02
 

haha ok cheers mate will PM you the info.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cgfc
Sr. Member
 
Avatar
Total Posts:  92
Joined:  2008-08-29
Montevideo, Uruguay
 
brendan. - 12 March 2009 01:52 PM

1. if its just a straight textbox use this.

<!-- Get Product Code -->
                
<?php if ($_product->getData('xxx put your attribute name here xxx')): ?>
                
<strong>Product Code: </strong><?php echo nl2br($_product->getData('xxx put your attribute name here xxx')) ?>
                <?php 
endif; ?>

2. if its a dropdown list use this
<!-- Get Product Colour -->
                
<?php if ($_product->getData('color')): ?>
                
<br>
                <
strong>Colour: </strong><?php echo  nl2br($_product->getResource()->getAttribute('color')->getFrontend()->getValue($_product)) ?>
                <?php 
endif; ?>

give me a shout if u get stuck

brendan

Hi brendan, I do what you sayd and it works perfect into the product list, but it doesn’t work in the new products list (when I use new.phtml), I think that’s beacuse I have to modify cataloog.xml, I try this:

<block type="catalog/product_new" name="product_new" template="catalog/product/new.phtml">
       <
reference name="product_new">
           <
action method="addAttribute"><attribute>presentation</attribute></action>
           <
action method="addAttribute"><attribute>dosage_instructions</attribute></action>
       </
reference>
</
block>

but still doesn’t work. any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

hey,

so your replacing the existing product.list in the catalog.xml file?
Or are you attemtping to call the new product list from inside a cms page?

I havent tried using the product_new from inside catalog.xml myself.

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
cgfc
Sr. Member
 
Avatar
Total Posts:  92
Joined:  2008-08-29
Montevideo, Uruguay
 
brendan. - 24 March 2009 11:22 AM

so your replacing the existing product.list in the catalog.xml file?

--> I don’t replace anything, I just add the new XML block into catalog.xml, it looks something like 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">
                    <
block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    </
block>
                    <
reference name="product_list">
                        <
action method="addAttribute"><attribute>presentation</attribute></action>
                        <
action method="addAttribute"><attribute>dosage_instructions</attribute></action>
                    </
reference>
                    <
action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </
block>
                <
block type="catalog/product_new" name="product_new" template="catalog/product/new.phtml">
                   <
reference name="product_new">
                       <
action method="addAttribute"><attribute>presentation</attribute></action>
                       <
action method="addAttribute"><attribute>dosage_instructions</attribute></action>
                   </
reference>
                </
block
            </
block>
        </
reference>
    </
catalog_category_default>
brendan. - 24 March 2009 11:22 AM

Or are you attemtping to call the new product list from inside a cms page?

--> Yes, I want to display the new arrivals into the home page, so I went into: CMS->Manage PAges-->Home and into content I wrote:

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

 
Magento Community Magento Community
Magento Community
Magento Community
 
EcomDev
Sr. Member
 
Avatar
Total Posts:  122
Joined:  2010-03-17
Ukraine, Kyiv
 

Hi,

I had the same problem, but i resolved it in different manner. Try to add few lines of code to your module configuration file:

<config>
       <
frontend>
           <
product>
                <
collection>
                    <
attributes>
                        <
my_custom_attribute_to_display_in_listing />
                    </
attributes>
                </
collection>
            </
product>
       </
frontend>
</
config>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2