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 1 of 4
Display product attributes in the category page
 
bnabilos
Jr. Member
 
Total Posts:  4
Joined:  2008-06-21
 

Hello,

I want to add the attributes in the category listing. When a user click on a category, it displays a list of all products in this category with a link to “Add to Cart”, I want to add above this the product attributes to allow user to select the option he wants and add it directly to the cart without taking him to an additional page to select options.

I’m using magento 1.6

Thanks for your help

 
Magento Community Magento Community
Magento Community
Magento Community
 
clickcomkyle
Jr. Member
 
Total Posts:  28
Joined:  2008-08-07
 

I am looking for the same thing. I have tried the following:
http://www.magentocommerce.com/wiki/how-to/add-attributes-to-product-grid
didnt work.

http://www.magentocommerce.com/boards/viewthread/15553/
which seemed promising, but still didnt work for the category list page.

also have tried many other attempts such as
http://www.magentocommerce.com/boards/viewthread/1610/P30/

But none of these have been successful. Maybe those will help you. Post here if you get it figured out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lies
Member
 
Total Posts:  58
Joined:  2008-05-07
 

You have to create configurable products, but first create your attributes trough the admin panel. Then you can create configurable products and assign them the attributes you want.

After that make sure that all your category and set to be “ANCHOR”.

You will see that your attributes will be shown in the SHOP BY.

Check this screen cast to see how to create configurable products :

http://www.magentocommerce.com/media/screencasts/configurable-products/view

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
clickcomkyle
Jr. Member
 
Total Posts:  28
Joined:  2008-08-07
 
Elias Deli - 10 October 2008 10:01 AM

You have to create configurable products, but first create your attributes trough the admin panel. Then you can create configurable products and assign them the attributes you want.

After that make sure that all your category and set to be “ANCHOR”.

You will see that your attributes will be shown in the SHOP BY.

Check this screen cast to see how to create configurable products :

http://www.magentocommerce.com/media/screencasts/configurable-products/view

Regards

Are you saying to get my custom attributes on the category page (list.phtml) the products have to be configurable products?

All my categories are set to ANCHOR. I do see the attribute in SHOP BY on the left, but I am looking to display the information under the name and price.

I am looking to do list out the important attributes under its description. I wouldnt think that this is so complicated. I have read a countless number of threads and i have not been able to get any of the solutions to work. I have modified the layout xml, created a module as suggested by the wiki, and now i have made a bunch of configurable products, but i still dont seem to have access to the custom attributes on the list.phtml. am i missing something?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hercilio Costa
Member
 
Total Posts:  59
Joined:  2008-07-15
 

I’m having the same problem here. I added an attribute in a lot of different pages, but I can’t add it in the Category List. I also tried the solutions of clickcomkyle links, but none work. Anyone find a solution??

 
Magento Community Magento Community
Magento Community
Magento Community
 
clickcomkyle
Jr. Member
 
Total Posts:  28
Joined:  2008-08-07
 

i did get this to work… but it requires a modification to the core files.

To get custom attributes on the category/search page (list.phtml)

modify:
\app\code\core\Mage\Catalog\Model\Layer.php

Add
$collection->addAttributeToSelect(’usage’); // whatever the attrubte name is
$collection->addAttributeToSelect(’outdoor’);

around line 63 (in the prepareProductCollection function)

The on the list.phtml template file add:
echo $_product->getResource()->getAttribute(’usage’)->getFrontend()->getValue($_product);
to pull the information… seems to work with text, dropdown and yes/no fields…

thats the only way i could get it to work. using version 1.1.6.

hope that helps someone else.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Spenlen
Jr. Member
 
Total Posts:  1
Joined:  2008-11-03
Rocklin, CA
 

Found an alternative that seems to be cleaner and doesn’t require modifying any code. In reviewing Mage_Catalog_Model_Config, this seems to be the “official” way to do it, though I can’t find a single mention of it in the documentation anywhere.

Inside your app/etc/modules directory, create a new file called category_product_attributes.xml. In that file, paste the following:

<?xml version="1.0"?>
<config>
  <
frontend>
    <
product>
      <
collection>
        <
attributes>
          <
usage/>
          <
outdoor/>
          <
box_size/>
        </
attributes>
      </
collection>
    </
product>
  </
frontend>
</
config>

Replace the sample attributes shown above with the attribute codes for your own custom attributes. Include as many as necessary. Then on the template/catalog/product/list.phtml page, the attributes will be available on the $_product object by calling the getData() method:

<?php echo $this->htmlEscape($_product->getData('usage')); ?>
<?php 
echo $this->htmlEscape($_product->getData('outdoor')); ?>
<?php 
echo $this->htmlEscape($_product->getData('box_size')); ?>

If it doesn’t work right away, make sure you refresh your configuration cache in the Magento Admin Panel under System > Cache Management.

 
Magento Community Magento Community
Magento Community
Magento Community
 
graphicmachine
Jr. Member
 
Total Posts:  5
Joined:  2008-03-17
 

Thanks. I just tested this in my 1.6 demo store and it appears to work… very clean solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
invaderflid
Member
 
Avatar
Total Posts:  59
Joined:  2008-10-21
Northport Long Island New York
 

Thanks Spenlen, worked like a charm.

 
Magento Community Magento Community
Magento Community
Magento Community
 
johnperspet
Jr. Member
 
Total Posts:  9
Joined:  2008-12-21
 

Won’t this get overwritten when you upgrade Magento later?

 
Magento Community Magento Community
Magento Community
Magento Community
 
castus
Member
 
Total Posts:  64
Joined:  2008-06-04
 
johnperspet - 29 December 2008 03:52 AM

Won’t this get overwritten when you upgrade Magento later?

It shouldn’t do unless you you use the defualt template - which would be silly!

Regarding the attributes, it works well on text field attributes, but just drags out the option_id when used with drop down style attributes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
castus
Member
 
Total Posts:  64
Joined:  2008-06-04
 

If you need to show the attribute for a drop down style attribute, use the following code in your template file >

echo $this->htmlEscape($_item->getAttributeText('color'));

instead of

echo $this->htmlEscape($_item->getData('color'));
 
Magento Community Magento Community
Magento Community
Magento Community
 
miked2004
Sr. Member
 
Avatar
Total Posts:  214
Joined:  2007-12-13
Atlanta, Georgia
 

Thanks, adding the attributes xml to the etc folder worked great. another way to call the attributes is $_product->getAttributeName() eg: $_product->getSellByPound()

 
Magento Community Magento Community
Magento Community
Magento Community
 
husby
Member
 
Avatar
Total Posts:  72
Joined:  2009-01-07
Roseville, MN
 

Has anyone figured out how to get a grouped product’s options to show up on the category list page?  I have grouped products and want the customer to be able to see all the products in the group and add them to their cart right from the list page, instead of having to go through the product details page.

Any help or pointers?  Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Maveck
Jr. Member
 
Total Posts:  22
Joined:  2008-08-21
 

Hello, I have the same problem here, I have to use two of my products attributes on the products list. But I don’t see them.

I can edit my attributes but can’t use them in product list page…

I tried some fixes but nothing could help me to make this work.

It’s a real big problem for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
proteam4
Jr. Member
 
Total Posts:  23
Joined:  2008-10-14
 

Hi,

I want the following code

echo $this->htmlEscape($_item->getAttributeText('color'));

to work on product sitemap. I want to display this attribute on Product sitemap.

But its not working on “/app/design/frontend/default/default/template/catalog/seo/sitemap.phtml” file. Please tell me how can i access this.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 4