Reputation: 2468
Id like to make this work inside themeName/template/page/html/head.phtml
<?php echo $_product->getId()
I'm trying to add a script in head section and it requires productID, but it only works inside catalog/product.
Is there a way to make it work in head section?
Upvotes: 0
Views: 2457
Reputation: 17656
Try
if($_product = Mage::registry('current_product')){
echo $_product->getId()
}
See Magento - Passing data between a controller and a block
Upvotes: 3