Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 3 of 3
Display SKU in frontend
 
Loaded Expert
Jr. Member
 
Total Posts:  25
Joined:  2008-05-10
Karachi
 

edit: I had to edit this file /app/design/frontend/base/default/template/catalog/product/view/type/grouped.phtml as i had grouped product. now issue is resolved.

I have made changes in /app/design/frontend/default/modern/template/catalog/product/view.phtml
and disabled all cache still i can’t see any change. I just added simple text after the product name but can’t see any change.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yumi
Jr. Member
 
Total Posts:  7
Joined:  2009-02-20
 

Just to say this useful bit of advice is still working in Magento 2.5

In the same file I was able to remove the “Quantity” column as I am not using quantity control.

Thanks
Michael

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nilsy
Jr. Member
 
Total Posts:  6
Joined:  2010-01-04
 
cmetrics - 20 November 2010 09:05 PM

What I did was go to ‘Manage Attributes’ and select ‘sku’ and set ‘Used in Product Listing’ to YES.

It should display right on the product page or under the ‘Additional Option’ tab.

Exactly what I was hoping to find. Thank you, cmetrics!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ronne Clay
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-11-11
 

sankaman2k,

Excelent. It works!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ingteractive
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2012-12-28
Otterlo
 

If you want to display the SKU at the detailed product description, you need to edit the description.phtml file, found at /app/design/frontend/default/your_template/template/catalog/product/view/description.phtml.

To fetch the product SKU you need to add:

<?php $_sku $this->getProduct()->getSku(); ?>

To display the product SKU you use:

<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_sku'Sku'?>

My description.phtml looks something like:

<?php $_description $this->getProduct()->getDescription(); ?>
<?php $_name 
$this->getProduct()->getName(); ?>
<?php $_sku 
$this->getProduct()->getSku(); ?>
<?php 
if ($_description): ?>
    
<div class="products-description">
        <
h2><?php echo $this->__('Product Description'?> <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_name'name'?></h2>
        
Artikelnummer<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_sku'Sku'?> </br
        <
div class="std">
            
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_description'description'?>
        
</div>
    </
div>
<?php endif; ?>

As you can see I have added the productname to the H2 tag for SEO purposes as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
optical
Member
 
Total Posts:  35
Joined:  2009-08-06
 

Where would I modify if I want this to be displayed for the category product view?

Bitterman - 12 November 2008 02:38 AM

One of the things keeping it from working may be that the Magento code is more object orientated than before. The old code snippet may no longer work with a newer version of Magento.

Here is what I used that worked:

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

Note the “$this->” and “htmlEscape” function instead of nl2br. Basically I made it look like the $_product->getName() line right above it, with the same syntax and functions it was using.

Finally, I placed this around line 47 in my file, /app/design/frontend/default/modern/template/catalog/product/view.phtml
This put the SKU right underneath the name of the product. If you’re using a different template, you’ll need to be sure you’re editing the correct file for your template. Finally the layout of your template may (and probably will) vary, so feel free to experiment with the placement.

Also be sure to clear your cache if you don’t see a change. Under Admin -> System -> Cache Management

Hope that helps.
 
Magento Community Magento Community
Magento Community
Magento Community
 
adykey
Jr. Member
 
Total Posts:  1
Joined:  2014-03-13
 

Hi, I have a Condition attribute for my store items (New, Refurbished, Open Box).
Now I need to show this attribute top of the SKU.

I don’t want use the “Visible on Product View Page on Front-end” because In that case Is displayed in “Additional Info”. I want to displayed exactly at the top of the SKU.

Please guide me
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 3 of 3