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

To print SKU on product info page
 
bimaljr
Jr. Member
 
Total Posts:  6
Joined:  2008-08-29
 

Hi,
I want to print product SKU in attributes section. Is there any way to do this?
I know there need some changes in /app/design/frontend/default/default/template/catalog/product/view/attributes.phtml
But I don’t know what to change.

Please help me

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
asrenzo
Member
 
Avatar
Total Posts:  42
Joined:  2008-02-25
France
 

Hi,

You need to create a new version of app/design/frontend/default/default/template/catalog/product/view.phtml and add this line where you want the Sku to show up.

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

Regards,

Laurent

 
Magento Community Magento Community
Magento Community
Magento Community
 
tonythemediaguy
Member
 
Total Posts:  31
Joined:  2008-08-16
 

How would I grab the sku for the product showing, but from within a different block. Like the sidebar or breadcrumbs? I tried the following in my bradcrumbs file, but the problem is that it is grabbing the id of whatever page I’m on whether or not I’m on a product page or not.

$idParams $this->getRequest()->getParam('id');
$cModel Mage::getModel('catalog/product');
$cModel->load($idParams);
echo (
$cModel->getSku());

Any ideas on how to get the current product SKU?

Thank You

Tony

 
Magento Community Magento Community
Magento Community
Magento Community
 
bimaljr
Jr. Member
 
Total Posts:  6
Joined:  2008-08-29
 
asrenzo - 19 December 2008 02:58 AM

Hi,

You need to create a new version of app/design/frontend/default/default/template/catalog/product/view.phtml and add this line where you want the Sku to show up.

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

Regards,

Laurent

Thank you asrenzo… it works

 
Magento Community Magento Community
Magento Community
Magento Community
 
tonythemediaguy
Member
 
Total Posts:  31
Joined:  2008-08-16
 

I know how to get the sku inside of view.phtml. My question is how can I call up the product info from outside of the product view. Specifically, from my breadcrumb bar.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
trish_strgb
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-01-23
Bochum, Germany
 

since you can get $_product by using

<?php $_product $this->getProduct(); ?>
have you tried
<?php echo $this->htmlEscape($this->getProduct()->getSku()); ?>
?
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top