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 2 of 3
Display SKU in frontend
 
dilbert4life
Jr. Member
 
Total Posts:  27
Joined:  2008-11-21
 
hondaspeder - 21 August 2008 07:26 AM

Is there another way to do this without having to go into the code?

Yes, And it is simple. You don’t need to create a new attribute as reefnut suggests, because the SKU attribute is already there and is exactly what we want to show. Simply log in to you admin panel, navigate to Catalog->Attributes->Manage Attributes, and then do a search for SKU in the attribute name field. Select SKU for editing, and near the bottom of the page, where it says Visible on Product View Page on Front-end, select yes. Your all set.

Check out this post on my blog - http://donaldmgilbert.com/?p=87

joya-joya - 04 December 2008 09:45 PM

reefnut - 12 November 2008 03:54 AM
Instead of changing any code at all why not just create another attribute with a name like model number or something and chosse to sisplay it on fromt end.

Except for the fact that it takes a few seconds longer to add the information it works fine.

This works, but if you have hundreds of products then it takes a heck of a lot longer then a few seconds...

Not really, refer to my answer to hondaspeder above. (I have nearly 700 products, and can turn this on/off at any time.)

 
Magento Community Magento Community
Magento Community
Magento Community
 
daisychainsaw
Member
 
Avatar
Total Posts:  35
Joined:  2008-03-28
 
benfrain.com - 10 October 2008 07:33 AM

Well, this had been working for me with no problems. Now for some reason it’s stopped. Anybody else had this problem? The

<?php echo nl2br($_product->getSku()) ?>
line is still there in my file (and also re-uploaded to make sure!)

Can I get this SKU to show up on the customer order (invoice) page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
IAG Design
Jr. Member
 
Total Posts:  15
Joined:  2008-05-06
 

Has anyone got this to work on Configurable Products? So it will display the SKU when you select the required options. The same way it displays the price.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MalT
Member
 
Total Posts:  71
Joined:  2008-09-07
Poland
 

Have anyone idea how to display SKU in grouped product

 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_lala
Member
 
Total Posts:  42
Joined:  2009-07-13
Germany
 
jonw101 - 26 January 2009 11:48 AM

One question.. How would i go about showing SKU’s for custom options as well…

would be nice if someone could answer this

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yogs7
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2010-01-12
 

How to display sku on Grouped Product ? pls someone help :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_lala
Member
 
Total Posts:  42
Joined:  2009-07-13
Germany
 

the sku for the grouped product or for its associated products?

 
Magento Community Magento Community
Magento Community
Magento Community
 
KingRichard
Jr. Member
 
Total Posts:  12
Joined:  2008-10-14
Sweden
 

Has anyone got this to work on Configurable Products?
I would be very grateful.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jabsolutions
Jr. Member
 
Total Posts:  10
Joined:  2008-08-18
 
yogeshlt - 24 March 2010 01:33 PM

How to display sku on Grouped Product ? pls someone help :(

if you follow above instructions
(modify view.phtml file) you can see sku also on gropped products
see this
http://luigidaltrozzo.it/store/index.php/anali-e-affinazione/gggggggg.html

I’ve addedd on line 49
this

<h3code <?php echo $this->htmlEscape($_product->getSku()) ?> </h3>
 
Magento Community Magento Community
Magento Community
Magento Community
 
myhan07
Jr. Member
 
Total Posts:  9
Joined:  2010-08-06
 

I’m running Magento 1.4.1.1 and I’ve tried every different get sku code I can find and none of them displays the sku on the product frontend… has this been updated? or am I doing something drastically wrong that borderlines stupidity??

 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2007-08-31
 
myhan07 - 16 August 2010 10:35 PM

I’m running Magento 1.4.1.1 and I’ve tried every different get sku code I can find and none of them displays the sku on the product frontend… has this been updated? or am I doing something drastically wrong that borderlines stupidity??

You must be doing something wrong, I’m on 1.4.1.1 and the following code worked fine:

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

This code has to be put in the following file to show on your product page:

/app/design/frontend/default/TEMPLATE/template/catalog/product/view.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
cmetrics
Jr. Member
 
Total Posts:  2
Joined:  2010-05-03
 

99% of the time there is no need to add extra code to you page in order to display the SKU on the product page.

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.

If you want to display the SKU on the product thumbnails...you will probably have to add code to your page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dbck
Jr. Member
 
Total Posts:  6
Joined:  2010-09-08
 

Thanks for the post dilbert4life, I was able to get the SKU number up on each product page! However, I’d like grouped products to show their individual product SKUs in the table instead of showing the grouped SKU number. The group SKU is a number I created and does not mean anything to my fulfillment company. If a customer calls in with a question and gives them my group SKU number, they have no idea what the customer is talking about!

I tried to add the bit of code (from a previous post) to the grouped.phtml page - it worked, but displayed the group SKU. Is there anyway to get the individual product SKUs to display?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dbck
Jr. Member
 
Total Posts:  6
Joined:  2010-09-08
 

YES! I was able to figure it out - pretty simple. I added the following code to the grouped.phtml file within the product table to display the individual SKU number!

<?php echo $this->htmlEscape($_item->getSKU()) ?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
matrixcruiser
Jr. Member
 
Total Posts:  12
Joined:  2008-10-12
 

thanks, guys. both snippets worked.

If you want to display the translated attribute title as well, add

<?php echo $this->__('SKU')?>

e.g.

<h3><?php echo $this->__('SKU')?><?php echo $this->htmlEscape($_product->getSku()) ?></h3>

same for the grouped.phtml, add the table header (along with the table field) for the SKU:

<th><?php echo $this->__('SKU'?></th>

...

<
td><?php echo $this->htmlEscape($_item->getSKU()) ?></td>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3