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

Accessing product page info from breadcrumbs.phtml
 
tonythemediaguy
Member
 
Total Posts:  31
Joined:  2008-08-16
 

Hi,

I’m trying to get the SKU of the product page I’m on, but only if I’m on a product page. If I’m on any other page I want it to show sku as null.
When I use the below, I am getting an SKU returned on category pages too. As far as I know the categories don’t have SKU. So how can I check if the current page has a “real SKU”. I’m grabbing the current id which is my problem on non-product pages. But I don’t know how else to grab the current product info.

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

Thank You for your time and Happy Holidays!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top