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:

http://www.carbonfiberhoods.com/exterior/hoods.html

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?

http://www.carbonfiberhoods.com/exterior/hoods.html

www_puertoricoautoforo_comAsked:
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.

NeoAshuraCommented:
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.
0
miked2004Commented:
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.
<config>
   <frontend>
      <product>
            <collection>
                <attributes>
                    <name_of_your_attribute />
                </attributes>
            </collection>
      </product>
   </frontend>
</config>

Open in new window

0
www_puertoricoautoforo_comAuthor Commented:
I added it here:

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


        <product>
            <collection>
                <attributes>
                    <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 />
                </attributes>
            </collection>
        </product>


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:

http://www.carbonfiberhoods.com/exterior/hoods/seibon-carbon-fiber-oem-style-carbon-fiber-hood-2009-2010-dodge-challenger.html


0
Cloud Class® Course: C++ 11 Fundamentals

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

miked2004Commented:
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.
0

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

http://75.127.116.143/exterior/body-kits/fronts.html

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

0
miked2004Commented:
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.
0
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
E-Commerce

From novice to tech pro — start learning today.