I'll prefix this by saying I'm a frontend guy, so forgive my general lack of knowledge but I am trying to learn. I'm using an addon called 'Zeon Manufacturer' (CE 1.9.2), basically associates a chosen manufacturer product attribute with further data about the manufacturer.
I'm trying to manipulate the manufacturers detail pages to add Schema/OpenGraph data but having trouble accessing the model within a block I've added to the head.phtml
, the only place that data can go. For example:
<meta property="og:description" content="<?php echo $_manufacturer->getDescription(); ?>">
On the page content block itself, view.phtml
, the variables I need are accessed as such:
$_manufacturer = $this->getManufacturer(); $example = echo $_manufacturer->getDescription();
I've also been able to access the model on product pages no issue using:
$manufacturerId = $_product->getManufacturer(); $_manufacturer = Mage::getModel('zeon_manufacturer/manufacturer')->load($manufacturerId, "manufacturer"); $example = echo $_manufacturer->getDescription();
However on my custom block, meta.phtml
, I can't any method I try to work:
$_manufacturer = $this->getManufacturer();
Or:
$_manufacturer = Mage::getModel('zeon_manufacturer/manufacturer')->load('example', "manufacturer");
I'm sure there's some core PHP concept I'm missing, perhaps the scope where I can access the model or limitations imposed on the head child blocks before the page content is generated?
I'm trying to learn so please forgive any naivity.
$_manufacturer = Mage::getModel('zeon_manufacturer/manufacturer')->load($identifier, "identifier");
- thank you @Prateek.