/** * Preprocessor for no-action reaction * * @return void */ protected function doNoAction() { parent::doNoAction(); $content = \XLite\Core\Request::getInstance()->id ? \XLite\Core\Database::getRepo('XLite\\Model\\IframeContent')->find(\XLite\Core\Request::getInstance()->id) : null; if ($content) { $method = $content->getMethod(); $url = $content->getUrl(); $body = $this->assembleFormBody($content); $html = <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body onload="javascript: document.getElementById('payment_form').submit();"> <form method="{$method}" id="payment_form" name="payment_form" action="{$url}"> <fieldset style="display: none;"> {$body} </fieldset> </form> </body> </html> HTML; print $html; exit; } else { $this->redirect(\XLite\Core\Converter::buildURL('checkout')); } }
/** * Redirect * * @return boolean */ public function doRedirect() { if ($this->getIframe()->getEnabled()) { $this->getIframe()->finalize(); } else { return parent::doRedirect(); } }
/** * Handles the request. * * @return void */ public function handleRequest() { if (!$this->isValidRequest()) { $this->display404(); $this->doRedirect(); } parent::handleRequest(); }
/** * Get fingerprint difference * * @params array $old Old fingerprint * @params array $new New fingerprint * * @return array */ protected function getCartFingerprintDifference(array $old, array $new) { $diff = parent::getCartFingerprintDifference($old, $new); $cellKeys = array('capostOfficeId', 'capostShippingZipCode'); foreach ($cellKeys as $name) { if ($old[$name] != $new[$name]) { $diff[$name] = $new[$name]; } } return $diff; }
/** * Handles the request. * Parses the request variables if necessary. Attempts to call the specified action function * * @return void */ public function handleRequest() { \XLite\Core\Session::getInstance()->iframePaymentData = null; // security check on return page $orderId = \XLite\Core\Request::getInstance()->order_id; if ($orderId != \XLite\Core\Session::getInstance()->last_order_id && $orderId != $this->getCart()->getOrderId()) { $this->redirect($this->buildURL('cart')); } else { parent::handleRequest(); } }
/** * Get return URL * * @return string */ public function getReturnURL() { $url = parent::getReturnURL(); if (\XLite\Core\Request::getInstance()->action) { $target = $this->getReturnTarget(); $params = array('product_id' => $this->getProductId()); $widget = \XLite\Core\Request::getInstance()->widget; if ($widget) { $params['widget'] = $widget; } $url = $this->buildURL($target, '', $params) . '#product-details-tab-reviews'; } return $url; }
/** * Get fingerprint difference * * @param array $old Old fingerprint * @param array $new New fingerprint * * @return array */ protected function getCartFingerprintDifference(array $old, array $new) { $diff = parent::getCartFingerprintDifference($old, $new); if (count($old['coupons']) !== count($new['coupons']) || count($old['coupons']) !== count(array_intersect($old['coupons'], $new['coupons']))) { $diff['coupons'] = array(); foreach (array_diff($new['coupons'], $old['coupons']) as $id) { $diff['coupons'][] = array('id' => $id, 'state' => 'added'); } foreach (array_diff($old['coupons'], $new['coupons']) as $id) { $diff['coupons'][] = array('id' => $id, 'state' => 'removed'); } } return $diff; }
/** * isSecure * TODO: check if this method is used * * @return void */ public function isSecure() { return $this->is('HTTPS') ? true : parent::isSecure(); }
/** * Check if current page is accessible * * @return boolean */ protected function checkAccess() { return parent::checkAccess() && $this->getOrder() && $this->checkOrderAccess() && $this->getOrder()->isCapostShippingMethod(); }
/** * Check if current page is accessible * * @return boolean */ public function checkAccess() { return parent::checkAccess(); }
/** * Add part to the location nodes list * * @return void */ protected function addBaseLocation() { parent::addBaseLocation(); foreach ($this->getCategoryPath() as $category) { if ($category->isVisible()) { $this->addLocationNode($category->getName(), $this->getCategoryURL($category), $this->getLocationNodeSubnodes($category)); } else { break; } } }
/** * Check if current page is accessible * * @return boolean */ protected function checkAccess() { return parent::checkAccess() && $this->getShipment() && $this->checkTrackingAccess(); }
/** * Check controller visibility * * @return boolean */ protected function isVisible() { return parent::isVisible() && $this->getPage(); }
/** * Return Viewer object * * @return \XLite\View\Controller */ public function getViewer($isExported = false) { return parent::getViewer(true); }
/** * Add the base part of the location path * * @return void */ protected function addBaseLocation() { parent::addBaseLocation(); $this->addLocationNode(static::t('Help zone')); }
/** * Perform some actions before redirect * * FIXME: check. Action should not be an optional param * * @param string|null $action Performed action OPTIONAL * * @return void */ protected function actionPostprocess($action = null) { parent::actionPostprocess($action); header('Content-type: application/json'); $data = json_encode($this->data); header('Content-Length: ' . strlen($data)); echo $data; exit(0); }
/** * Check if current page is accessible * * @return boolean */ protected function checkAccess() { return parent::checkAccess() && ('download' != $this->getAction() || $this->getStorage()); }
/** * Check if current page is accessible * * @return boolean */ protected function checkAccess() { return parent::checkAccess() && !\XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance()->isEmpty(); }
/** * Get pages templates * * @return array */ protected function getPageTemplates() { $list = parent::getPages(); $list['default'] = 'order/list.tpl'; return $list; }
/** * Add part to the location nodes list * * @return void */ protected function addBaseLocation() { parent::addBaseLocation(); $this->addLocationNode('X-Payments'); }
/** * Handles the request * * @return void */ public function handleRequest() { \XLite\Core\Request::getInstance()->action = 'callback'; parent::handleRequest(); }
/** * Add part to the location nodes list * * @return void */ protected function addBaseLocation() { parent::addBaseLocation(); if (!$this->isRegisterMode()) { $this->addLocationNode(static::t('My account')); } }
/** * Perform some actions before redirect * * FIXME: check. Action should not be an optional param * * @param string $action Current action OPTIONAL * * @return void */ protected function actionPostprocess($action = null) { parent::actionPostprocess($action); if ($action) { $this->assembleReturnURL(); } }
/** * Define the actions with no secure token * * @return array */ public static function defineFreeFormIdActions() { $list = parent::defineFreeFormIdActions(); $list[] = 'get_tree'; return $list; }
/** * Add the base part of the location path * * @return void */ protected function addBaseLocation() { parent::addBaseLocation(); $this->addLocationNode(static::t('Search for orders'), $this->buildURL('order_list')); }
/** * Handles the request. * Parses the request variables if necessary. Attempts to call the specified action function * * @return void */ public function handleRequest() { parent::handleRequest(); $this->headerStatus(404); }
/** * Check if current page is accessible * * @return boolean */ public function checkAccess() { return parent::checkAccess() && \XLite\Core\Config::getInstance()->CDev->ContactUs->enable_form; }
/** * Check - controller must work in secure zone or not * * @return boolean */ public function isSecure() { return 'logoff' !== \XLite\Core\Request::getInstance()->action ? \XLite\Core\Config::getInstance()->Security->customer_security : parent::isSecure(); }
/** * Add part to the location nodes list * * @return void */ protected function addBaseLocation() { parent::addBaseLocation(); $this->addLocationNode('My account'); }
/** * Get the full URL of the page * * @param string $url Relative URL OPTIONAL * @param boolean $secure Flag to use HTTPS OPTIONAL * @param array $params Optional URL params OPTIONAL * * @return string */ public function getShopURL($url = '', $secure = null, array $params = array()) { $add = (strpos($url, '?') ? '&' : '?') . 'feed=' . \XLite\Core\Request::getInstance()->action; return parent::getShopURL($url . $add, $secure, $params); }