Magento Themes and Magento Extensions

Magento – Display the SKU on a Product Page


Magento’s default theme doesn’t display the SKU on the product page. This is a pretty easy modification to get this working properly.

In whichever theme you’re using, in the file template/catalog/product/view.phtml, add the line:

<?php echo $this->htmlEscape($_product->getSku()) ?>

Here’s a few lines of my view.phtml to give you some context:

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form">

         <?php echo $this->getChildHtml('media') ?>

         <h3><?php echo $this->htmlEscape($_product->getName()) ?></h3>
         <?php echo $this->htmlEscape($_product->getSku()) ?>

         <?php if ($this->canEmailToFriend()): ?>

Comments are closed.