public function getOptionValues()
 {
     if (!$this->_values) {
         parent::getOptionValues();
         //build _values up.
         if ($this->_values) {
             $optionMap = array();
             foreach ($this->getProduct()->getOptions() as $option) {
                 $optionMap[$option->getOptionId()] = array();
                 $i = 0;
                 foreach ($option->getValues() as $value) {
                     $optionMap[$option->getOptionId()][$i++] = ($value->getIsCustomTag() ?: 0) + 0;
                 }
             }
             foreach ($this->_values as $returnValObj) {
                 $optionValues = $returnValObj->getData('optionValues');
                 if ($optionValues) {
                     foreach ($optionValues as $i => $valArr) {
                         $optionValues[$i]['is_custom_tag'] = $optionMap[$returnValObj->getId()][$i];
                     }
                     $returnValObj->setData('optionValues', $optionValues);
                 }
             }
         }
     }
     return $this->_values;
 }
Exemple #2
0
 /**
  * Retrieve html templates for different types of product custom options
  *
  * @return string
  */
 public function getTemplatesHtml()
 {
     $canEditPrice = $this->getCanEditPrice();
     $canReadPrice = $this->getCanReadPrice();
     $this->getChild('swatch_option_type')->setCanReadPrice($canReadPrice)->setCanEditPrice($canEditPrice);
     $templates = parent::getTemplatesHtml() . "\n" . $this->getChildHtml('swatch_option_type');
     return $templates;
 }
Exemple #3
0
 /**
  * Rewrite to use custom precision (http://support.etwebsolutions.com/issues/466)
  *
  * @param $value
  * @param $type
  * @return string
  */
 public function getPriceValue($value, $type)
 {
     $options = Mage::helper('currencymanager')->getOptions(array());
     if (isset($options["input_admin"]) && isset($options['precision'])) {
         if ($type == 'percent') {
             return number_format($value, $options['precision'], null, '');
         } elseif ($type == 'fixed') {
             return number_format($value, $options['precision'], null, '');
         }
     }
     return parent::getPriceValue($value, $type);
 }
 public function getOptionValues()
 {
     parent::getOptionValues();
     $optionsArr = array_reverse($this->getProduct()->getOptions(), true);
     foreach ($optionsArr as $option) {
         foreach ($this->_values as &$value) {
             if ($value['id'] == $option->getOptionId()) {
                 $value['validators'] = $option->getValidators();
             }
         }
     }
     return $this->_values;
 }
 public function getOptionValues()
 {
     $values = parent::getOptionValues();
     $optionsArr = array_reverse($this->getProduct()->getOptions(), true);
     //Add our regex attribute data
     foreach ($values as $value) {
         $option = $optionsArr[$value->getOptionId()];
         $value->setRegex($option->getRegex());
         $value->setRegexMessage($option->getRegexMessage());
     }
     $this->_values = $values;
     return $this->_values;
 }
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('customoptiondescription/catalog/product/edit/options/option.phtml');
 }
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('edge/customoptionimage/product/edit/options/option.phtml');
 }
Exemple #8
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('scene7/catalog/product/edit/options/option.phtml');
 }