Ejemplo n.º 1
0
    /**
     * 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'));
        }
    }
Ejemplo n.º 2
0
 /**
  * Preprocessor for no-action run
  *
  * @return void
  */
 protected function doNoAction()
 {
     parent::doNoAction();
     if (!$this->isAJAX()) {
         \XLite\Core\Session::getInstance()->productListURL = $this->getURL();
     }
 }