コード例 #1
0
ファイル: Default.php プロジェクト: booklein/bookle
 /**
  * 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;
 }
コード例 #2
0
 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');
 }
コード例 #3
0
 public function getOptionHtml(Mage_Catalog_Model_Product_Option $option)
 {
     $type = $option->getType();
     if (empty($type)) {
         return;
     }
     return parent::getOptionHtml($option);
 }
コード例 #4
0
 /**
  * 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;
 }
コード例 #5
0
ファイル: OptionsTest.php プロジェクト: nemphys/magento2
 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');
     }
 }
コード例 #6
0
ファイル: Options.php プロジェクト: Eximagen/BulletMagento
 /**
  * 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();
 }
コード例 #7
0
ファイル: Options.php プロジェクト: votanlean/Magento-Pruebas
 /**
  * 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');
 }
コード例 #8
0
ファイル: Options.php プロジェクト: nemphys/magento2
 /**
  * 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');
 }
コード例 #9
0
 public function __construct()
 {
     parent::__construct();
 }
コード例 #10
0
ファイル: Options.php プロジェクト: brobie/magento_scene7
 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');
 }