Have part # display under product thumbnail in Grid View? Magentocommerce

Hi, I would like to have my part # displayed underneath my products.  It does this after I click on the product, but I would like it to display the part # underneath the product in "Grid or List" view.  How could I do this?

I read a book on customizing Magento, actually a couple, but I did not see anything that talked about the grid or list view of a product.

If you click here, you can see some carbon fiber hoods for sale:


You'll notice that this page displays the thumbnail, name, price, special price of each carbon fiber hood but it does not display the part #.  How can I have the part number appear on the actual Grid page instead of just the detail page?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

firstly give people a chance to see the question at least 48 hours before you request attention, secondly we could need the code you have used to create the website/grid so we can look over it and see where it is that the current data is coming from. only then can we help with the # number. that is the easy part. please include all the code for that pages. any php and any html files you use to get it looking how it looks. along with any database structures.
Here is how:

In your "/template/catalog/product/list.phtml" is where this code is controlled. The top part of the file controls the list view and the bottom controls the grid view.

You will see a for each loop that displays the products. You need to add $_product->getSku(); (assuming that is the part number you are talking about) or #_product->getPartNumber() or what ever you called that attribute.

You will need to do this for both the list and grid view areas in this file, to have it show for both views.

If the attribute still does not show up you might need to tell Magento to allays load it into the collection. You can do this by editing the catalog modules config.xml file(/app/code/Mage/catalog/etc/config.xml), or what I would do is create a custom module and make this change in it. This xml structure should already exist so just add your attribute code into the attributes node.

That will do exactly what you need.
                    <name_of_your_attribute />

Open in new window

www_puertoricoautoforo_comAuthor Commented:
I added it here:

modified "app/code/core/Mage/Catalog/etc/config.xml"
to now include the following

                    <name />
                    <url_key />
                    <part_number />        (this is the only line that I changed)
                    <price />
                    <special_price />
                    <special_from_date />
                    <special_to_date />
                    <short_description />
                    <thumbnail />
                    <small_image />
                    <image_label />
                    <thumbnail_label />
                    <small_image_label />
                    <tax_class_id />
                    <status />
                    <news_from_date />
                    <news_to_date />
                    <created_at />
                    <updated_at />

However, when I refresh the Dodge Challenger carbon fiber hood it does not show the part #, if I click on the item then click on additional information I can see it, but I'm trying to get it to appear at this screen:


Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

You need to add $product->getPartNumber() to ""/template/catalog/product/list.phtml" in order to display it. Editing the Xml file just made sure that it was always loaded into the collection.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
www_puertoricoautoforo_comAuthor Commented:
I added this code, but I get the following error..

Parse error: syntax error, unexpected T_VARIABLE in /home/webmaster/domains/raceonusa.com/public_html/app/design/frontend/default/raceonusa/template/catalog/product/list.phtml on line 92

When I take out the underscore from the beginning of "_products" I get this error:
Fatal error: Call to a member function getPartNumber() on a non-object in /home/webmaster/domains/raceonusa.com/public_html/app/design/frontend/default/raceonusa/template/catalog/product/list.phtml on line 125

Do you think it's the spelling of the words "Part Number"?
In the attributes page next to "Attribute Code" it is  "part_number"
In my admin and store view it is "Part Number'
<h2 class="part-number-custom"><?php echo $this->htmlEscape(_$product->getPartNumber()) ?></h2>

Open in new window

Your Product variable should be declared in the page some where. It will probably be $product or $_product. In either case _$produt is wrong. That is what you need to fix.

The dollar sign will always go first.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.