/** * Get form field by option * * @param \XLite\Model\Config $option Option * * @return array */ protected function getFormFieldByOption(\XLite\Model\Config $option) { $cell = parent::getFormFieldByOption($option); if ('redirect_to_cart' == $option->getName() && $cell) { $module = \XLite\Core\Database::getRepo('XLite\\Model\\Module')->findModuleByName('XC\\Add2CartPopup'); $url = $module->getInstalledURL(); $cell[static::SCHEMA_COMMENT] = static::t('This option is ignored as Add to Cart Popup module is installed and enabled.', array('url' => $url)); } return $cell; }
/** * Get form field by option * * @param \XLite\Model\Config $option Option * * @return array */ protected function getFormFieldByOption(\XLite\Model\Config $option) { $cell = parent::getFormFieldByOption($option); if ('redirect_to_cart' == $option->getName() && $cell) { $limit = \XLite\View\Pager\Admin\Module\Manage::getInstance()->getItemsPerPage(); $pageId = \XLite\Core\Database::getRepo('XLite\\Model\\Module')->getInstalledPageId('XC', 'Add2CartPopup', $limit); $params = array('clearCnd' => 1, 'page' => $pageId); $url = $this->buildURL('addons_list_installed', '', $params) . '#' . 'Add2CartPopup'; $cell[static::SCHEMA_COMMENT] = static::t('This option is ignored as Add to Cart Popup module is installed and enabled.', array('url' => $url)); } return $cell; }
/** * Get form field by option * * @param \XLite\Model\Config $option Option * * @return array */ protected function getFormFieldByOption(\XLite\Model\Config $option) { $cell = parent::getFormFieldByOption($option); switch ($option->getName()) { case 'trialEnabled': case 'entryPointSeparator': case 'entryPointDHL': case 'DHLAccessKey': case 'entryPointFEDEX': case 'entryPointUPS': case 'entryPointUSPS': $cell[static::SCHEMA_DEPENDENCY] = array(static::DEPENDENCY_SHOW => array('accountId' => array(''))); break; case 'fallbackRateValue': $cell[static::SCHEMA_DEPENDENCY] = array(static::DEPENDENCY_SHOW => array('fallbackRate' => array('I', 'O'))); break; case 'package': case 'insurable': $cell[static::SCHEMA_DEPENDENCY] = array(static::DEPENDENCY_SHOW => array('calculationMethod' => array('C'))); break; case 'fixedFeeMode': $cell[static::SCHEMA_DEPENDENCY] = array(static::DEPENDENCY_SHOW => array('calculationMethod' => array('F'))); break; case 'fixedFeeCode': $cell[static::SCHEMA_DEPENDENCY] = array(static::DEPENDENCY_SHOW => array('calculationMethod' => array('F'), 'fixedFeeMode' => array('C'))); break; case 'fixedFee1': case 'fixedFee2': $cell[static::SCHEMA_DEPENDENCY] = array(static::DEPENDENCY_SHOW => array('calculationMethod' => array('F'), 'fixedFeeMode' => array('F'))); break; } if ($option->getName() == 'trialEnabled') { if (!\XLite\Module\XC\AuctionInc\Main::isXSTrialPeriodValid()) { $cell[static::SCHEMA_VALUE] = false; $cell[\XLite\View\FormField\Input\Checkbox\OnOff::PARAM_DISABLED] = true; } } return $cell; }