コード例 #1
0
 /**
  * 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'];
 }
コード例 #2
0
ファイル: HeadTest.php プロジェクト: nemphys/magento2
 /**
  * Test getRobots
  *
  * @magentoConfigFixture default_store design/search_engine_robots/default_robots INDEX,NOFOLLOW
  */
 public function testGetRobots()
 {
     $this->assertEquals('INDEX,NOFOLLOW', $this->_block->getRobots());
 }