/** * Get option html block * * @param Mage_Catalog_Model_Product_Option $option */ public function getOptionHtml(Mage_Catalog_Model_Product_Option $option) { $html = parent::getOptionHtml($option); $html = str_replace('opConfig.reloadPrice()', 'return;', $html); $html = str_replace('name="options[', 'name="cart[' . $this->getItem()->getId() . '][options][', $html); return $html; }
public function getOptionHtml(Mage_Catalog_Model_Product_Option $option) { $type = $option->getType(); if (empty($type)) { return; } return parent::getOptionHtml($option); }
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'); } }
/** * Get option html block * * @param Mage_Catalog_Model_Product_Option $option */ public function getOptionHtml(Mage_Catalog_Model_Product_Option $option) { if (!Mage::helper('aitcg/options')->checkAitOption($option) || $option->getData("image_template_id") == 0) { return parent::getOptionHtml($option); } //forsing to change file-group template to our own $renderer = $this->getOptionRender('cgfile'); //PairedProduct forse add own options if ($renderer['block'] != 'aitcg/catalog_product_view_options_type_file') { $renderer['block'] = 'aitcg/catalog_product_view_options_type_file'; $renderer['template'] = 'aitcg/view/options/type/cgfile.phtml'; } if (is_null($renderer['renderer'])) { $renderer['renderer'] = $this->getLayout()->createBlock($renderer['block'])->setTemplate($renderer['template']); } return $renderer['renderer']->setProduct($this->getProduct())->setOption($option)->toHtml(); }