Magento Themes and Magento Extensions

Magento – Display the SKU on a Product Page

Share

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:

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

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

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

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

Comments are closed.