/** * Get _gaq options list * * @return array */ protected function getGaqOptions() { $list = array(sprintf('\'_setAccount\', \'%s\'', \XLite\Core\Config::getInstance()->CDev->GoogleAnalytics->ga_account)); if (2 == \XLite\Core\Config::getInstance()->CDev->GoogleAnalytics->ga_tracking_type) { $list[] = '\'_setDomainName\', \'.\' + self.location.host.replace(/^[^\\.]+\\./, \'\')'; } elseif (3 == \XLite\Core\Config::getInstance()->CDev->GoogleAnalytics->ga_tracking_type) { $list[] = '\'_setDomainName\', \'none\''; $list[] = '\'_setAllowLinker\', true'; } $list[] = '\'_trackPageview\''; $controller = \XLite::getController(); if ($this->isEcommercePartEnabled() && $controller instanceof \XLite\Controller\Customer\CheckoutSuccess) { $orders = \XLite\Core\Session::getInstance()->gaProcessedOrders; if (!is_array($orders)) { $orders = array(); } $order = $this->getOrder(); if ($order->getProfile() && !in_array($order->getOrderId(), $orders)) { $bAddress = $order->getProfile()->getBillingAddress(); $city = $bAddress ? $bAddress->getCity() : ''; $state = $bAddress && $bAddress->getState() ? $bAddress->getState()->getState() : ''; $country = $bAddress && $bAddress->getCountry() ? $bAddress->getCountry()->getCountry() : ''; $tax = $order->getSurchargeSumByType(\XLite\Model\Base\Surcharge::TYPE_TAX); $shipping = $order->getSurchargeSumByType(\XLite\Model\Base\Surcharge::TYPE_SHIPPING); $list[] = '\'_addTrans\', ' . '\'' . $order->getOrderNumber() . '\', ' . '\'' . $this->escapeJavascript(\XLite\Core\Config::getInstance()->Company->company_name) . '\', ' . '\'' . $order->getTotal() . '\', ' . '\'' . $tax . '\', ' . '\'' . $shipping . '\', ' . '\'' . $this->escapeJavascript($city) . '\', ' . '\'' . $this->escapeJavascript($state) . '\', ' . '\'' . $this->escapeJavascript($country) . '\''; foreach ($order->getItems() as $item) { $list[] = '\'_addItem\', ' . '\'' . $order->getOrderNumber() . '\', ' . '\'' . $this->escapeJavascript($item->getSku()) . '\', ' . '\'' . $this->escapeJavascript($item->getName()) . '\', ' . '\'\', ' . '\'' . $item->getPrice() . '\', ' . '\'' . $item->getAmount() . '\''; } $list[] = '\'_trackTrans\''; $orders[] = $order->getOrderId(); \XLite\Core\Session::getInstance()->gaProcessedOrders = $orders; } } return $list; }
/** * Get prepared pages array for tabber * * @return void */ protected function getTabberPages() { $pages = array(); $url = $this->get('url'); $switch = $this->getParam(self::PARAM_SWITCH); $functionName = $this->getParam(self::PARAM_TAB_PAGES); // $functionName - from PARAM_TAB_PAGES parameter $dialogPages = \XLite::getController()->{$functionName}(); if (is_array($dialogPages)) { foreach ($dialogPages as $page => $title) { $p = new \XLite\Base(); $pageURL = preg_replace('/' . $switch . '=(\\w+)/', $switch . '=' . $page, $url); $p->set('url', $pageURL); $p->set('title', $title); $pageSwitch = sprintf($switch . '=' . $page); $p->set('selected', preg_match('/' . preg_quote($pageSwitch) . '(\\Z|&)/Ss', $url)); $pages[] = $p; } } // if there is only one tab page, set it as a seleted with the default URL if (1 == count($pages) || 'default' === $this->getPage()) { $pages[0]->set('selected', $url); } return $pages; }
/** * Get required fields by address type * * @param string $atype Address type code * * @return array */ public function getRequiredFieldsByType($atype) { $list = parent::getRequiredFieldsByType($atype); if ('express_checkout_return' === \XLite::getController()->getAction()) { $list = array_diff($list, array('phone')); } return $list; }
/** * get Shipping Method name * for Canada Post add '(Canada Post)' (except admin area, shipping methods page) * * @return string */ public function getName() { $name = parent::getName(); if ('capost' == $this->getProcessor() && !(\XLite::isAdminZone() && \XLite::getController() instanceof \XLite\Controller\Admin\ShippingMethods)) { $name = 'Canada Post ' . $name; } return $name; }
/** * Define buttons widgets * * @return array */ protected function defineButtons() { $list = parent::defineButtons(); if (\XLite::getController()->isOrderEditable()) { $list['sendNotification'] = $this->getSendNotificationWidget(); $list['recalculate'] = $this->getRecalculateButton(); } return $list; }
/** * Check if product can be purchased * * @return boolean */ public function isOutOfStock() { $result = parent::isOutOfStock(); if (!$result) { $membership = \XLite::getController() instanceof \XLite\Controller\ACustomer ? \XLite::getController()->getCart()->getProfile()->getMembership() : null; $result = $this->getAvailableAmount() < $this->getProduct()->getMinQuantity($membership); } return $result; }
/** * Get default options for selector * * @return array */ protected function getDefaultOptions() { $list = array(); /** @var \XLite\Model\Shipping\Method $method */ $method = \XLite::getController()->getMethod(); $processor = $method->getProcessorObject(); $packageBoxTypeOptions = $processor->getPackageBoxTypeOptions(); foreach ($packageBoxTypeOptions as $option) { $list[$option['code']] = $option['name']; } return $list; }
/** * Check if field is valid and (if needed) set an error message * * @param array $data Current section data * @param string $section Current section name * * @return void */ protected function validateFields(array $data, $section) { parent::validateFields($data, $section); if ('default' == $section && \XLite::getController() instanceof \XLite\Controller\Admin\Module && 'CDev\\AmazonS3Images' == $this->getModule()->getActualName() && !$this->errorMessages) { $vars = array(); foreach ($data[self::SECTION_PARAM_FIELDS] as $field) { $vars[$field->getName()] = $field->getValue(); } $client = \XLite\Module\CDev\AmazonS3Images\Core\S3::getInstance(); if (!empty($vars['access_key']) && !empty($vars['secret_key']) && !empty($vars['bucket']) && !$client->checkSettings($vars['access_key'], $vars['secret_key'], $vars['bucket'])) { $this->addErrorMessage('access_key', 'Connection to Amazon S3 failed.' . ' Check whether the AWS Access key и AWS Secret key specified in the module settings are correct.', $data); } } }
/** * Get _gaq options list * * @return array */ protected function getGaqOptions() { $list = array('\'_setAccount\', \'' . \XLite\Core\Config::getInstance()->GoogleAnalytics->ga_account . '\''); if (2 == \XLite\Core\Config::getInstance()->GoogleAnalytics->ga_tracking_type) { $list[] = '\'_setDomainName\', \'.\' + self.location.host.replace(/^[^\\.]+\\./, \'\')'; } elseif (3 == \XLite\Core\Config::getInstance()->GoogleAnalytics->ga_tracking_type) { $list[] = '\'_setDomainName\', \'none\''; $list[] = '\'_setAllowLinker\', true'; } $list[] = '\'_trackPageview\''; $list[] = '\'_trackPageLoadTime\''; $controller = \XLite::getController(); if ($controller instanceof \XLite\Controller\Customer\CheckoutSuccess) { $orders = \XLite\Core\Session::getInstance()->gaProcessedOrders; if (!is_array($orders)) { $orders = array(); } $order = $this->getOrder(); if (!in_array($order->getOrderId(), $orders)) { foreach ($order->getItems() as $item) { $product = $item->getProduct(); $category = $product ? $product->getCategory() : null; if ($category && $category->getCategoryId()) { $categories = \XLite\Core\Database::getRepo('XLite\\Model\\Category')->getCategoryPath($category->getCategoryId()); $category = array(); foreach ($categories as $cat) { $category[] = $cat->getName(); } $category = implode(' / ', $category); } else { $category = ''; } $list[] = '\'_addItem\', ' . '\'' . $order->getOrderId() . '\', ' . '\'' . $this->escapeJavascript($item->getSku()) . '\', ' . '\'' . $this->escapeJavascript($item->getName()) . '\', ' . '\'\', ' . '\'' . $item->getPrice() . '\', ' . '\'' . $item->getAmount() . '\''; } $bAddress = $order->getProfile()->getBillingAddress(); $city = $bAddress ? $bAddress->getCity() : ''; $state = $bAddress && $bAddress->getState() ? $bAddress->getState()->getState() : ''; $country = $bAddress && $bAddress->getCountry() ? $bAddress->getCountry()->getCountry() : ''; $tax = $order->getSurchargeSumByType('TAX'); $shipping = $order->getSurchargeSumByType('SHIPPING'); $list[] = '\'_addTrans\', ' . '\'' . $order->getOrderId() . '\', ' . '\'' . $this->escapeJavascript(\XLite\Core\Config::getInstance()->Company->company_name) . '\', ' . '\'' . $order->getTotal() . '\', ' . '\'' . $tax . '\', ' . '\'' . $shipping . '\', ' . '\'' . $this->escapeJavascript($city) . '\', ' . '\'' . $this->escapeJavascript($state) . '\', ' . '\'' . $this->escapeJavascript($country) . '\''; $list[] = '\'_trackTrans\''; $orders[] = $order->getOrderId(); \XLite\Core\Session::getInstance()->gaProcessedOrders = $orders; } } return $list; }
/** * Get validator * * @return \XLite\Core\Validator\HashArray */ protected function getValidator() { $validator = parent::getValidator(); $validator->addPair('email', new \XLite\Core\Validator\String\Email(), \XLite\Core\Validator\Pair\APair::SOFT); $validator->addPair('password', new \XLite\Core\Validator\String(), \XLite\Core\Validator\Pair\APair::SOFT); $validator->addPair('create_profile', new \XLite\Core\Validator\String\Switcher(), \XLite\Core\Validator\Pair\APair::SOFT); $validator->addPair('guest_agree', new \XLite\Core\Validator\String\Switcher(), \XLite\Core\Validator\Pair\APair::SOFT); $validator->addPair('same_address', new \XLite\Core\Validator\String\Switcher(), \XLite\Core\Validator\Pair\APair::SOFT); $onlyCalculate = (bool) \XLite\Core\Request::getInstance()->only_calculate; $mode = $onlyCalculate ? \XLite\Core\Validator\Pair\APair::SOFT : \XLite\Core\Validator\Pair\APair::STRICT; $nonEmpty = !$onlyCalculate; // Shipping address $shippingAddress = $validator->addPair('shippingAddress', new \XLite\Core\Validator\HashArray(), \XLite\Core\Validator\Pair\APair::SOFT); $addressFields = \XLite::getController()->getAddressFields(); $isCountryStateAdded = false; foreach ($addressFields as $fieldName => $fieldData) { if (in_array($fieldName, array('country_code', 'state_id'))) { if (!$isCountryStateAdded) { $shippingAddress->addPair(new \XLite\Core\Validator\Pair\CountryState()); $isCountryStateAdded = true; } } else { $mode = $onlyCalculate || !$fieldData[\XLite\View\Model\Address\Address::SCHEMA_REQUIRED] ? \XLite\Core\Validator\Pair\APair::SOFT : \XLite\Core\Validator\Pair\APair::STRICT; $shippingAddress->addPair($fieldName, new \XLite\Core\Validator\String($nonEmpty && $fieldData[\XLite\View\Model\Address\Address::SCHEMA_REQUIRED]), $mode); } } $shippingAddress->addPair('save_in_book', new \XLite\Core\Validator\String\Switcher(), \XLite\Core\Validator\Pair\APair::SOFT); // Billing address if (!\XLite\Core\Request::getInstance()->same_address) { $billingAddress = $validator->addPair('billingAddress', new \XLite\Core\Validator\HashArray(), \XLite\Core\Validator\Pair\APair::SOFT); $isCountryStateAdded = false; foreach ($addressFields as $fieldName => $fieldData) { if (in_array($fieldName, array('country_code', 'state_id'))) { if (!$isCountryStateAdded) { $billingAddress->addPair(new \XLite\Core\Validator\Pair\CountryState()); $isCountryStateAdded = true; } } else { $billingAddress->addPair($fieldName, new \XLite\Core\Validator\String($nonEmpty && $fieldData[\XLite\View\Model\Address\Address::SCHEMA_REQUIRED]), $mode); } } $billingAddress->addPair('save_in_book', new \XLite\Core\Validator\String\Switcher(), \XLite\Core\Validator\Pair\APair::SOFT); } return $validator; }
/** * Check - specified item is active or not * * @param array $item Menu item * * @return boolean */ protected function isActiveItem(array $item) { $result = parent::isActiveItem($item); if (false === $item['controller']) { $result = \XLite::getInstance()->getShopURL($item['url']) === \XLite\Core\URLManager::getCurrentURL() ?: $result; } else { if (!is_array($item['controller'])) { $item['controller'] = array($item['controller']); } $controller = \XLite::getController(); foreach ($item['controller'] as $controllerName) { if ($controller instanceof $controllerName) { $result = true; break; } } } return $result; }
/** * Get GA options list * * @return array */ protected function getGAOptions() { $str = "'create', '" . \XLite\Core\Config::getInstance()->CDev->GoogleAnalytics->ga_account . "', 'auto'"; if (2 == \XLite\Core\Config::getInstance()->CDev->GoogleAnalytics->ga_tracking_type) { $str .= ', {cookieDomain: \'.\' + self.location.host.replace(/^[^\\.]+\\./, \'\')}'; } elseif (3 == \XLite\Core\Config::getInstance()->CDev->GoogleAnalytics->ga_tracking_type) { $str .= ", {'allowLinker': true}"; } $list = array($str); $list[] = "'send', 'pageview'"; $controller = \XLite::getController(); if ($this->isEcommercePartEnabled() && $controller instanceof \XLite\Controller\Customer\CheckoutSuccess) { $orders = \XLite\Core\Session::getInstance()->gaProcessedOrders; if (!is_array($orders)) { $orders = array(); } $order = $this->getOrder(); if (!in_array($order->getOrderId(), $orders) && $order->getProfile()) { $bAddress = $order->getProfile()->getBillingAddress(); $city = $bAddress ? $bAddress->getCity() : ''; $state = $bAddress && $bAddress->getState() ? $bAddress->getState()->getState() : ''; $country = $bAddress && $bAddress->getCountry() ? $bAddress->getCountry()->getCountry() : ''; $tax = $order->getSurchargeSumByType(\XLite\Model\Base\Surcharge::TYPE_TAX); $shipping = $order->getSurchargeSumByType(\XLite\Model\Base\Surcharge::TYPE_SHIPPING); $list[] = "'require', 'ecommerce'"; $list[] = "'ecommerce:addTransaction', {" . "'id': '" . $order->getOrderNumber() . "', " . "'affiliation': '" . $this->escapeJavascript(\XLite\Core\Config::getInstance()->Company->company_name) . "', " . "'revenue': '" . $order->getTotal() . "', " . "'tax': '" . $tax . "', " . "'shipping': '" . $shipping . "'}"; foreach ($order->getItems() as $item) { $list[] = "'ecommerce:addItem', {" . "'id': '" . $order->getOrderNumber() . "', " . "'sku': '" . $this->escapeJavascript($item->getSku()) . "', " . "'name': '" . $this->escapeJavascript($item->getName()) . "', " . "'price': '" . $item->getPrice() . "', " . "'quantity': '" . $item->getAmount() . "'}"; } $list[] = "'ecommerce:send'"; $orders[] = $order->getOrderId(); \XLite\Core\Session::getInstance()->gaProcessedOrders = $orders; } } return $list; }
/** * Returns cart * * @return \XLite\Model\Cart */ protected function getCart() { return $this->getParam(static::PARAM_CART) ?: \XLite::getController()->getCart(); }
/** * Get accessible shop URL * * @return string */ protected function getClosedShopURL() { return \XLite::getController()->getAccessibleShopURL(false); }
/** * doQuery * * @param array $data Data * @param boolean $ignoreCache Flag: if true then do not get rates from cache * * @return array */ protected function doQuery($data, $ignoreCache) { $rates = array(); $key = $this->getConfigurationFingerPrint() . serialize($data); if (!$ignoreCache) { $cachedResponse = $this->getDataFromCache($key); } $response = null; if (isset($cachedResponse)) { $response = $cachedResponse; } elseif (!\XLite\Model\Shipping::isIgnoreLongCalculations()) { $APIConnector = $this->getAPIConnector(); $this->setRequestData($data); $status = false; if (\XLite\Module\XC\AuctionInc\Main::isSSAvailable()) { $status = $APIConnector->GetItemShipRateSS($response); } elseif (\XLite\Module\XC\AuctionInc\Main::isXSAvailable()) { $methods = $this->getEnabledMethods(); if (count($methods)) { $status = $APIConnector->GetItemShipRateXS($response); } } $this->logResponse($status, $data, $response); if ($status) { $this->saveDataInCache($key, $response); // drop selected shipping method to set it to cheapest if (!\XLite::isAdminZone()) { /** @var \XLite\Model\Cart $cart */ $cart = \XLite::getController()->getCart(); $cart->setShippingId(0); if ($cart->getProfile()) { $cart->getProfile()->setLastShippingId(0); } } } elseif (isset($response['ErrorList'])) { // report error $errorMessages = array(); foreach ($response['ErrorList'] as $error) { $errorMessages[] = $error['Message']; } $this->errorMsg = implode('; ', $errorMessages); } } if ($response && empty($this->errorMsg)) { $rates = $this->parseResponse($response); } else { $this->saveDataInCache($key, $response, static::CACHE_TTL); } if (!$response || empty($rates)) { // Apply fallback rate if (empty($rates) && 'N' != \XLite\Core\Config::getInstance()->XC->AuctionInc->fallbackRate) { $rateValue = $this->getFallbackRateValue($data['package']); $rate = new \XLite\Model\Shipping\Rate(); $rate->setBaseRate($rateValue); $method = $this->findMethod('FF', 'FIXEDFEE', 'Fixed fee'); $rate->setMethod($method); $rates[] = $rate; $this->errorMsg = null; } } return $rates; }
/** * Do Capture, Void or Refund request. * Returns false on failure or redirects admin back to the order page * the necessary actions with the backend transaction are taken in the * Callback request processing * * @param \XLite\Model\Payment\BackendTransaction $transaction Trandaction * @param string $paymentAction Payment action * * @return boolean */ protected function doSecondary(\XLite\Model\Payment\BackendTransaction $transaction, $paymentAction) { if (!array_key_exists($paymentAction, $this->secondaryActionsMap)) { return false; } if (\XLite\Core\Request::getInstance()->trn_id) { $pt = \XLite\Core\Database::getRepo('XLite\\Model\\Payment\\Transaction')->find(\XLite\Core\Request::getInstance()->trn_id); } else { $pt = $transaction->getPaymentTransaction(); } $method = $this->secondaryActionsMap[$paymentAction]['method']; $action = $this->secondaryActionsMap[$paymentAction]['action']; $result = $this->client->{$method}($pt->getDataCell('xpc_txnid')->getValue(), $pt, \XLite\Core\Request::getInstance()->amount); if ($result->isSuccess()) { $response = $result->getResponse(); if ('1' == $response['status']) { \XLite\Core\TopMessage::getInstance()->addInfo($response['message'] ? 'Transaction was ' . $action . ' with message: ' . $response['message'] : 'Operation successfull'); $controller = \XLite::getController()->redirectBackToOrder(); exit; } else { if ($response['error']) { $message = 'Transaction was not ' . $action . 'with error: ' . $response['error']; } elseif ($response['message']) { $message = 'Transaction was not ' . $action . 'with message: ' . $response['message']; } else { $mesage = 'Operation failed'; } \XLite\Core\TopMessage::getInstance()->addError($message); } } else { $message = 'Operation failed'; if ($result->getError()) { $messsage .= '. ' . $result->getError(); } \XLite\Core\TopMessage::getInstance()->addError($message); } return false; }
/** * Get URL of referral page * * @param \XLite\Model\Payment\Method $method Payment method * * @return string */ public function getReferralPageURL(\XLite\Model\Payment\Method $method) { $api = \XLite\Module\CDev\Paypal\Main::getRESTAPIInstance(); $controller = \XLite::getController(); if ($api->isInContextSignUpAvailable()) { $returnUrl = $controller->getShopURL($controller->buildURL('paypal_settings', 'update_credentials')); $url = $api->getSignUpUrl($returnUrl); } else { $url = parent::getReferralPageURL($method); } return $url; }
/** * Get default options * * @return array */ protected function getDefaultOptions() { return \XLite::getController()->isOrderEditable() ? $this->getShippingOptions() : array(); }
/** * Get javascript code * * @return string */ public function getJSCode() { $message = $this->getError() ? 'paymentFormSubmitError' : 'ready'; $returnURL = \XLite::getController()->getReturnURL() ? \XLite::getController()->getReturnURL() : ''; $error = $this->getError() ? htmlspecialchars($this->getError(), ENT_QUOTES) : ''; $type = $this->getType(); return <<<JS function onload() { msg = { message: '{$message}', params: { height: document.body.clientHeight, error: '{$error}', returnURL: '{$returnURL}', type: {$type} } }; if (window.parent !== window && window.JSON) { window.parent.postMessage(JSON.stringify(msg), '*'); } else { window.location = '{$returnURL}'; } } JS; }
/** * Link session cell name with related list * * @return string */ protected function getSessionCell() { $cell = parent::getSessionCell() . '_' . \XLite::getController()->getPagerSessionCell(); return $cell; }
/** * FIXME - backward compatibility * * @param string $name Property name * * @return mixed */ public function get($name) { $value = parent::get($name); return null !== $value ? $value : \XLite::getController()->get($name); }
/** * Return true if current page is 'Recently installed addon' page * * @return boolean */ protected function isRecentlyInstalledPage() { return method_exists(\XLite::getController(), 'isRecentlyInstalledPage') ? \XLite::getController()->isRecentlyInstalledPage() : false; }
/** * Returns current order * * @return \XLite\Model\Order */ protected function getOrder() { return \XLite::getController()->getOrder(); }
/** * Checks whether the tabs navigation is visible, or not * * @return boolean */ protected function isTabsNavigationVisible() { return !\XLite::getController() instanceof \XLite\Controller\Admin\Settings && 1 < count($this->getTabberPages()); }
/** * Returns processor id * * @return string */ protected function getProcessorId() { return \XLite::getController()->getProcessorId(); }
/** * Get an array of address fields * * @return array */ protected function getAddressFields() { $result = \XLite::getController()->getAddressFields(); if ($this->isEmailVisible()) { $result['email'] = array(\XLite\View\Model\Address\Address::SCHEMA_CLASS => 'XLite\\View\\FormField\\Input\\Text\\CheckoutEmail', \XLite\View\Model\Address\Address::SCHEMA_LABEL => 'Email', \XLite\View\Model\Address\Address::SCHEMA_REQUIRED => true, \XLite\View\Model\Address\Address::SCHEMA_MODEL_ATTRIBUTES => array(\XLite\View\FormField\Input\Base\String::PARAM_MAX_LENGTH => 'length'), \XLite\View\FormField\AFormField::PARAM_WRAPPER_CLASS => 'address-email', \XLite\View\FormField\AFormField::PARAM_COMMENT => static::t('Your order details will be sent to your e-mail address'), \XLite\View\FormField\AFormField::PARAM_ATTRIBUTES => array('class' => 'progress-mark-owner'), 'additionalClass' => $this->getEmailClassName()); } if ($this->isPasswordVisible()) { $result['password'] = array(\XLite\View\Model\Address\Address::SCHEMA_CLASS => 'XLite\\View\\FormField\\Input\\PasswordVisible', \XLite\View\Model\Address\Address::SCHEMA_LABEL => 'Password', \XLite\View\Model\Address\Address::SCHEMA_REQUIRED => true, \XLite\View\Model\Address\Address::SCHEMA_MODEL_ATTRIBUTES => array(\XLite\View\FormField\Input\Base\String::PARAM_MAX_LENGTH => 'length'), \XLite\View\FormField\AFormField::PARAM_WRAPPER_CLASS => 'password', 'additionalClass' => $this->getPasswordClassName()); } return $result; }
/** * Widget parameters * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(static::PARAM_DISPLAY_MODE => new \XLite\Model\WidgetParam\Set('Display mode', $this->getDisplayMode(), true, $this->displayModes), static::PARAM_ICON_MAX_WIDTH => new \XLite\Model\WidgetParam\Int('Maximal icon width', \XLite::getController()->getDefaultMaxImageSize(true, \XLite\Logic\ImageResize\Generator::MODEL_CATEGORY, 'Default'), true), static::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int('Maximal icon height', \XLite::getController()->getDefaultMaxImageSize(false, \XLite\Logic\ImageResize\Generator::MODEL_CATEGORY, 'Default'), true)); }
/** * Check CLI access * * @return boolean */ protected function checkCronAccess() { return \XLite::getController() instanceof \XLite\Controller\Console\Cron; }
/** * Return true if order is not editable and items list should be displayed in static mode * * @return boolean */ protected function isStatic() { return parent::isStatic() || !\XLite::getController()->isOrderEditable(); }
/** * Get option translation storage * * @param \XLite\Module\CDev\ProductOptions\Model\Option $option Option * @param string $field Field name * * @return \XLite\Module\CDev\ProductOptions\Model\OptionTranslation */ public function getOptionTranslation(\XLite\Module\CDev\ProductOptions\Model\Option $option, $field) { return $option->getSoftTranslation(\XLite::getController()->getCurrentLanguage())->{$field}; }