Show product SKU’s in Magento Frontend
I have had many requests from customers of my web store (http://store.reformu.com) to be able to view the pruduct SKU on the frontend of the store, as many of them have a complete products catalog already, and most of the time order via SKU rather than names of products. Magento offers a way for this to happen, but it was not ideal for me, because it only showed the SKU on the actual product description page, instead of on the description page AND the regular navigation of the site pages.
Well, after some reading on http://magentoecommerce.com, I have come up with a solution. Add the following line to the tail of your price.phtml, and it will display the SKU right after the price of the product, no matter what page it is on.
<h5>SKU: <?php echo nl2br($_product->getSku()) ?></h5>
The price.phtml file is located (relative to your magento directory) in app/design/frontend/*template*/*view*/template/catalog/product/price.phtml . You can either download it via FTP and then edit and reupload, or refer to another post on here about opening .phtml files directly off your site right in dreamweaver. (I actually log in via SSH and use nano to edit most things like this.)
The reason I chose it to display in h5 is because that fit best size and color wise with my template. You can select any size, although I believe h5 is the best.
By the way – for the curious, to turn on SKU’s for product pages Magento’s way, log in to your Magento Admin panel. Navigate to Cataog->Attributes->Manage Atributes. Search for SKU in the attriute name field, and the select SKU to edit it. Near the bottom of that page is an option that says “Visible on Product View Page on Front-end.” Change that to “yes” and you are all set. However, as I stated before, the downside to this is that it displays the SKU on the product view page only.
Links:
http://www.magentocommerce.com/boards/viewthread/6404/#t24042 <–where I got the idea for what code to display.


