/** * Customize meta robots tags when viewing product. * * @return string */ public function getRobots() { parent::getRobots(); if (($_product = Mage::registry('current_product')) && ($robots = $_product->getAttributeText('inchoo_meta_robots'))) { $this->_data['robots'] = $robots; } return $this->_data['robots']; }
/** * Test getRobots * * @magentoConfigFixture default_store design/search_engine_robots/default_robots INDEX,NOFOLLOW */ public function testGetRobots() { $this->assertEquals('INDEX,NOFOLLOW', $this->_block->getRobots()); }