Magento Core: Display "SKU" attribute to both Product View & Product List pages

Send Snippet To: Save this snippet to Code Collector Pro -- view all tamburra's snippets
language: Other
license: Other

Code for Snippet:

                
---------------
Open:
---------------
 
/app/design/frontend/base/default/template/catalog/product/view.phtml
 
 
---------------
Find :
---------------
 
            <div class="product-name">
                <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
            </div>
 
 
---------------
Change To:
---------------
 
            <div class="product-name">
                <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>SKU:&nbsp;<?php echo $this->htmlEscape($_product->getData('manufacturer_sku')); ?>
            </div>
 
 
---------------
Open:
---------------
 
/app/design/frontend/base/default/template/catalog/product/list.phtml
 
 
---------------
Find (Both Instances):
---------------
 
                    <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
 
 
---------------
Change To:
---------------
 
                    <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a><br><span style="font-size: 10px;">SKU:&nbsp;<?php echo $this->htmlEscape($_product->getData('manufacturer_sku')); ?></span></h2>
comments powered by Disqus

Info

Tags: Core CE 1.6

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 3002
Date Added: 2012-01-24 06:07:57
Last Modified: 0000-00-00 00:00:00

Web Analytics