/** * Unset all options with prices * * (non-PHPdoc) * @see Mage_Catalog_Block_Product_View_Options::getOptions() */ public function getOptions() { $options = parent::getOptions(); foreach ($options as $key => $option) { /* @var $option Mage_Catalog_Model_Product_Option */ if (Mage::helper('editcustomoptions')->isOptionAffectingPrice($option)) { unset($options[$key]); } } return $options; }
public function testGetOptionHtml() { $this->_block->addOptionRenderer('select', 'Mage_Catalog_Block_Product_View_Options_Type_Select', 'product/view/options/type/select.phtml'); $this->_block->addOptionRenderer('date', 'Mage_Catalog_Block_Product_View_Options_Type_Date', 'product/view/options/type/date.phtml'); $this->_block->setLayout(Mage::app()->getLayout()); $html = false; foreach ($this->_block->getOptions() as $option) { $html = $this->_block->getOptionHtml($option); $this->assertContains('Test', $html); /* contain Test in option title */ } if (!$html) { $this->fail('Product with options is required for test'); } }