/** * 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 __construct(array $args = array()) { parent::__construct(); if (isset($args['product'])) { $this->_product = $args['product']; } $this->addOptionRenderer('text', 'catalog/product_view_options_type_text', 'catalog/product/view/options/type/text.phtml')->addOptionRenderer('file', 'catalog/product_view_options_type_file', 'catalog/product/view/options/type/file.phtml')->addOptionRenderer('select', 'catalog/product_view_options_type_select', 'catalog/product/view/options/type/select.phtml')->addOptionRenderer('date', 'catalog/product_view_options_type_date', 'catalog/product/view/options/type/date.phtml')->setTemplate('catalog/product/view/options.phtml'); }
public function getOptionHtml(Mage_Catalog_Model_Product_Option $option) { $type = $option->getType(); if (empty($type)) { return; } return parent::getOptionHtml($option); }
/** * 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'); } }
/** * 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(); }
/** * Constructor for our block with options * * @return void */ public function __construct() { parent::__construct(); $this->addOptionRenderer('default', 'catalog/product_view_options_type_default', 'catalog/product/composite/fieldset/options/type/default.phtml'); }
/** * Constructor for our block with options * * @return void */ public function __construct() { parent::__construct(); $this->addOptionRenderer('default', 'Mage_Catalog_Block_Product_View_Options_Type_Default', 'catalog/product/composite/fieldset/options/type/default.phtml'); }
public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct(); $this->addOptionRenderer(Achang_Scene7_Model_Catalog_Product_Option::OPTION_GROUP_SCENE7SELECT, 'scenescene7/product_view_options_type_scene7select', 'scene7/catalog/product/view/options/type/scene7select.phtml'); $this->addOptionRenderer(Achang_Scene7_Model_Catalog_Product_Option::OPTION_GROUP_SCENE7TEXT, 'scenescene7/catalog/product_view_options_type_scene7text', 'scene7/catalog/product/view/options/type/scene7text.phtml'); }