Magento

eCommerce Software for Online Growth

Magento Forum

From setting up your store to managing your products, pages and promotions to generating detailed reports, the Magento User Guide empowers the user to utilize the platform for all of its vast capacity.
Available in eBook and Print formats – Download Now!!!
   
Page 2 of 3
Display product attributes in the category page
 
Maveck
Jr. Member
 
Total Posts:  22
Joined:  2008-08-21
 

Hell....

I’m sorry, this works, my rsync wasn’t updating the file…

I’m sorry.

Thanks for this clean solution.

 Signature 

M@veck, looking for a fix to use his brain as it should be used…

Hu..., and a fix to fix his stupid bad english…

M@veck is french, and don’t care, he’s just smiling all the time.

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

Hello,

I’m looking for a way to get products attributes that I have added into my order history and my order details.

I just need my attributes to be loaded every time I load a product.

Is it possible to define product properties everywhere or must I create a config file to every location I want some attributes ?

 Signature 

M@veck, looking for a fix to use his brain as it should be used…

Hu..., and a fix to fix his stupid bad english…

M@veck is french, and don’t care, he’s just smiling all the time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
scorxn
Jr. Member
 
Total Posts:  16
Joined:  2008-10-20
 

Try this before getting too carried away with custom code:

http://www.magentocommerce.com/boards/viewreply/98455/

 
Magento Community Magento Community
Magento Community
Magento Community
 
shriti
Jr. Member
 
Total Posts:  2
Joined:  2008-06-20
 

Any idea on how to fix this? I want to show color dropdown on category page, so that customer can add products to cart from category page.

 Signature 

Customised Web Development Services

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

I’m still wondering if anyone knows how to do this for grouped products.  Instead of showing product options for a simple product, I want to show the grouped subproducts right on the category listing page.

Any suggestions?  I have a small budget, but am willing to pay someone if they can help code this!

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
derrickhunter
Jr. Member
 
Total Posts:  4
Joined:  2008-11-14
 
Spenlen - 12 November 2008 08:07 PM

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.

Thanks a lot !
This is the cleanest and nicest solution !

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

Yes, that is a very nice solution.  But does anyone have a fix to show the grouped subproducts on the category list page?  I have products that each have 2-3 products grouped together, and I’d like to have the customer see the available products and be able to add them to their cart right from the category listing page.  Any ideas?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Joshua Barrie
Member
 
Total Posts:  49
Joined:  2009-01-02
 
proteam4 - 20 January 2009 10:15 PM

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.

That code wont work, and i didnt understand either untill i realised it should be

<?php echo $this->htmlEscape($_product->getAttributeText('color'));  ?>

notice the ITEM should be PRODUCT.

At least that worked for me.

 Signature 

Joshua Barrie

Magento stores folio (completed);
Discount Trophies
Priceless Perfume

 
Magento Community Magento Community
Magento Community
Magento Community
 
Phillip Hughes
Member
 
Total Posts:  34
Joined:  2008-05-19
 

OK I have copied the instructions exactly but since 1.3.0 it does not show the attribute I have requested I have used the following code in the xml file:

<config>
<frontend>
<product>
<collection>
<attributes>
<manufacturer/>
</attributes>
</collection>
</product>
</frontend>
</config>

and then on the frontend: (list.phtml)

echo $this->htmlEscape($_product->getData(’manufacturer’));

Can anyone help this is essential for our site

Thanks,

Phil

 
Magento Community Magento Community
Magento Community
Magento Community
 
jorenrapini
Jr. Member
 
Total Posts:  8
Joined:  2009-03-02
 

Thank you very much Spenlen, your solution solved my problem quickly!

 
Magento Community Magento Community
Magento Community
Magento Community
 
kab8609
Sr. Member
 
Avatar
Total Posts:  84
Joined:  2009-04-07
Cleveland
 
Phillip Hughes - 16 April 2009 07:42 AM

OK I have copied the instructions exactly but since 1.3.0 it does not show the attribute I have requested I have used the following code in the xml file:

<config>
<frontend>
<product>
<collection>
<attributes>
<manufacturer/>
</attributes>
</collection>
</product>
</frontend>
</config>

and then on the frontend: (list.phtml)

echo $this->htmlEscape($_product->getData(’manufacturer’));

Can anyone help this is essential for our site

Thanks,

Phil

Change it to this: <?php echo $_product->getAttributeText('manufacturer')?>

This worked for me (although i’m still working on the spacing issue). You have to add it in two spots in the list.phtml file

 Signature 

Kris

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Guru
 
Avatar
Total Posts:  588
Joined:  2009-02-26
Minneapolis MN
 

I am trying to get this to work in 1.3.1.1 and I am not having any success. Perhaps I am missing a step

I created this file category_product_attributes.xml

<?xml version="1.0" encoding="utf-8" ?>
<config>
  <
frontend>
    <
product>
      <
collection>
        <
attributes>
          <
yeast></yeast>     
        </
attributes>
      </
collection>
    </
product>
  </
frontend>
</
config>

I added this to my list.phtml page

<?php
                    try{
            
                
if($_product['has_options']){
                 
echo '<span class="required">*Has Option</span>';            
                 echo 
$_product->getAttributeText('yeast');                
                   
}
                }
                
catch(exception $e)
                
{
                    
echo $e->getMessage();
                    
}
        ?>

NADA?

 Signature 

Brent W. Peterson S.C.J.E.
What did I just finish?:Midwest Supplies.com
What am I working on now?: Sizzlepicks.com
What cool thing did I do lately?:Really cool quick order form
My James Joyce Quote:He found in the world without as actual what was in his world within as possible.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LIKETHEDEAD
Jr. Member
 
Total Posts:  4
Joined:  2009-06-23
 

i tried to do this, as you said, and made the xml file and the changes to list.phtml
after refreshing caches i get this error

Warningsimplexml_load_string() [function.simplexml-load-string]Entityline 71parser error AttValue" or ' expected  in /********/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 294
Trace:
#0 /*******/magento/app/code/core/Mage/Core/Model/Layout/Update.php(294): mageCoreErrorHandler(2, 'simplexml_load_...', '/*****...', 294, Array)
#1 /*****/magento/app/code/core/Mage/Core/Model/Layout/Update.php(320): Mage_Core_Model_Layout_Update->fetchFileLayoutUpdates('

any ideas? i’ve even deletet the lines in list.phtml and the xml file and refreshed the chaches, still get the message. kind of annoying

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Guru
 
Avatar
Total Posts:  588
Joined:  2009-02-26
Minneapolis MN
 

I have everything working here

http://www.magentocommerce.com/boards/viewthread/21039/P15/#t148102

You can see it at

http://new.midwestsupplies.com/

I think I was on the wrong path when I went through on this thread.

 Signature 

Brent W. Peterson S.C.J.E.
What did I just finish?:Midwest Supplies.com
What am I working on now?: Sizzlepicks.com
What cool thing did I do lately?:Really cool quick order form
My James Joyce Quote:He found in the world without as actual what was in his world within as possible.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LIKETHEDEAD
Jr. Member
 
Total Posts:  4
Joined:  2009-06-23
 

now i’m really pissed. i even get that error message when i’ve re-installed magento (but not my database), and as soon as i refresh caches, baam. crash of doom!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 3
 
© Copyright 2010 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
196425 users|1377 users currently online|363502 forum posts