Пример #1
0
 /**
  * Get option text
  *
  * @param \XLite\Module\CDev\ProductOptions\Model\OptionGroup $option Option class
  *
  * @return string
  */
 public function getOptionText(\XLite\Module\CDev\ProductOptions\Model\OptionGroup $option)
 {
     $selected = $this->getParam(self::PARAM_SELECTED_OPTIONS);
     return is_array($selected) && isset($selected[$option->getGroupId()]) ? $selected[$option->getGroupId()] : '';
 }
Пример #2
0
 /**
  * Create option
  *
  * @param \XLite\Module\CDev\ProductOptions\Model\OptionGroup $group  Option group
  * @param array                                               $option Option data
  *
  * @return \XLite\Module\CDev\ProductOptions\Model\Option
  */
 protected function createOption(\XLite\Module\CDev\ProductOptions\Model\OptionGroup $group, array $option)
 {
     $model = new \XLite\Module\CDev\ProductOptions\Model\Option();
     $group->addOptions($model);
     $model->setGroup($group);
     return $model;
 }
Пример #3
0
 /**
  * Check - is not option group part of specified exception or not
  *
  * @param array                                               $exception Exception cell
  * @param \XLite\Module\CDev\ProductOptions\Model\OptionGroup $group     Option group
  *
  * @return boolean
  */
 public function isNotPartException(array $exception, \XLite\Module\CDev\ProductOptions\Model\OptionGroup $group)
 {
     return !isset($exception[$group->getGroupId()]);
 }
Пример #4
0
 /**
  * Get option group link
  *
  * @param \XLite\Module\CDev\ProductOptions\Model\OptionGroup $option Option group
  *
  * @return string
  */
 public function getOptionGroupLink(\XLite\Module\CDev\ProductOptions\Model\OptionGroup $option)
 {
     return $this->buildURL('product', '', array('page' => 'product_options', 'product_id' => $this->getProductId(), 'groupId' => $option->getGroupId(), 'language' => \XLite\Core\Request::getInstance()->language));
 }