/** * Return field value * * @return mixed */ public function getValue() { $value = parent::getValue(); if (true === $value || '1' === $value || 'Y' === $value) { $value = 1; } elseif (false === $value || '0' === $value || 'N' === $value) { $value = 0; } return $value; }
/** * Return field value * * @return mixed */ public function getValue() { $value = parent::getValue(); if ($value === true || $value === '1' || $value === 1) { $value = static::YES; } elseif ($value === false || $value === '0' || $value === 0) { $value = static::NO; } return $value; }
/** * Get current wave value * * @return string */ public function getValue() { $value = parent::getValue(); $waves = $this->getWaves(); if ($waves) { if (empty($value) || !isset($waves[$value]) && !is_numeric($value)) { $waveKeys = array_keys($waves); $value = array_pop($waveKeys); } } return $value; }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(static::PARAM_IS_MANDATORY => new \XLite\Model\WidgetParam\Bool('Is mandatory', false, false), static::PARAM_ALLOWED_OPTIONS => new \XLite\Model\WidgetParam\Collection('Allowed options', null)); }
/** * Set common attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function setCommonAttributes(array $attrs) { $attrs = parent::setCommonAttributes($attrs); $attrs['data-value'] = $this->getValue(); return $attrs; }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_USE_CODE_AS_KEY => new \XLite\Model\WidgetParam\Bool('Use currency codes as keys', false)); }
/** * Assemble classes * * @param array $classes Classes * * @return array */ public function assembleClasses(array $classes) { $classes = parent::assembleClasses($classes); $classes[] = 'not-significant'; return $classes; }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_ORDER => new \XLite\Model\WidgetParam\String('Order', '')); }
/** * Get common attributes * * @return array */ protected function getCommonAttributes() { $attributes = parent::getCommonAttributes(); $value = $this->getValue(); if (!$this->getMethod() && $this->getOrderEntity()->getShippingMethodName()) { $value = static::KEY_DELETED; } if ($this->getMethod() && !in_array($this->getMethod()->getMethodId(), array_keys($this->shippingOptions))) { $value = static::KEY_UNAVAILABLE; } $attributes['data-value'] = $value; $attributes['data-request-options'] = !$this->isBuildOptions(); return $attributes; }
/** * Return field value * * @return mixed */ public function getValue() { return parent::getValue() ?: 'C'; }
/** * Prepare attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function prepareAttributes(array $attrs) { $attrs = parent::prepareAttributes($attrs); $attrs['class'] = (empty($attrs['class']) ? '' : $attrs['class'] . ' ') . 'rich'; return $attrs; }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_ATTRIBUTE => new \XLite\Model\WidgetParam\Object('Attribute', null, false, 'XLite\\Model\\Attribute'), self::PARAM_PRODUCT => new \XLite\Model\WidgetParam\Object('Product', null, false, 'XLite\\Model\\Product')); }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(static::PARAM_E => new \XLite\Model\WidgetParam\Int('Exp part', 2)); }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { return parent::isVisible() && 1 < count($this->getParam(static::PARAM_AVAILABLE_TYPES)); }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_COUNTRY => new \XLite\Model\WidgetParam\String('Country', '')); }
/** * Register CSS files * * @return array */ public function getCSSFiles() { $list = parent::getCSSFiles(); $list[] = 'modules/XC/ProductFilter/form_field/select/use_classes/style.css'; return $list; }
/** * getOptions * * @return array */ protected function getOptions() { return array('' => 'Select one...') + parent::getOptions(); }
/** * Set common attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function setCommonAttributes(array $attrs) { return parent::setCommonAttributes($attrs) + array('data-placeholder' => static::t('Select options'), 'data-selected-text' => static::t('# selected'), 'data-disable-search' => $this->getParam(static::PARAM_DISABLE_SEARCH)); }
/** * Return field value * * @return mixed */ public function getValue() { return intval(parent::getValue()); }
/** * Get value container class * * @return string */ protected function getValueContainerClass() { return parent::getValueContainerClass() . ' country-selector'; }
/** * Set common attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function setCommonAttributes(array $attrs) { return parent::setCommonAttributes($attrs) + array('size' => 1); }
/** * Check - current value is selected or not * * @param mixed $value Value * * @return boolean */ protected function isOptionSelected($value) { return $this->getValue() ? parent::isOptionSelected($value) : $value == date_default_timezone_get(); }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_ORDER_ID => new \XLite\Model\WidgetParam\Int('Order ID', null, false), self::PARAM_ALL_OPTION => new \XLite\Model\WidgetParam\Bool('Show "All" option', false, false)); }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_ORDER => new \XLite\Model\WidgetParam\Object('Order', null, false, '\\XLite\\Model\\Order'), self::PARAM_ALL_OPTION => new \XLite\Model\WidgetParam\Bool('Show "All status" option', false, false)); }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(static::PARAM_ALL_OPTION => new \XLite\Model\WidgetParam\Bool('Show "All statuses" option', false, false)); }
/** * Return field value * * @return mixed */ public function getValue() { return parent::getValue() ?: static::SKIN_STANDARD; }
/** * Set common attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function setCommonAttributes(array $attrs) { $list = parent::setCommonAttributes($attrs); $list['onchange'] = 'javascript: if (this.form.weight_symbol) { this.form.weight_symbol.value = this.value; }'; return $list; }