Example #1
0
 public function setTemplate($template)
 {
     if (_PS_VERSION_ >= '1.5') {
         parent::setTemplate($template);
     } else {
         $this->template = $template;
     }
 }
Example #2
0
 public function setTemplate($template)
 {
     if (version_compare(_PS_VERSION_, '1.5', 'ge')) {
         parent::setTemplate($template);
     } else {
         $this->template = $template;
     }
 }
Example #3
0
                    Tools::redirectLink(__PS_BASE_URI__ . '/modules/paypal/express_checkout/submit.php?' . $query);
                } else {
                    $controller = new FrontController();
                    $controller->init();
                    Tools::redirect(Context::getContext()->link->getModuleLink('paypal', 'submit', $values));
                }
            }
        } else {
            // If Cart changed, no need to keep the paypal data
            unset(Context::getContext()->cookie->{PaypalExpressCheckout::$COOKIE_NAME});
            $ppec->logs[] = $ppec->l('Cart changed since the last checkout express, please make a new Paypal checkout payment');
        }
    }
    if (_PS_VERSION_ < '1.5') {
        $display = new BWDisplay();
    } else {
        $display = new FrontController();
    }
    // Display payment confirmation
    if ($ppec->ready && Tools::getValue('get_confirmation')) {
        if (_PS_VERSION_ < '1.5') {
            $currency = new Currency((int) $ppec->getContext()->cart->id_currency);
            $ppec->getContext()->smarty->assign(array('form_action' => PayPal::getShopDomainSsl(true, true) . _MODULE_DIR_ . $ppec->name . '/express_checkout/submit.php', 'total' => Tools::displayPrice($ppec->getContext()->cart->getOrderTotal(true), $currency), 'logos' => $ppec->paypal_logos->getLogos(), 'use_mobile' => (bool) $ppec->getContext()->getMobileDevice()));
            $display->setTemplate(_PS_MODULE_DIR_ . 'paypal/views/templates/front/order-summary.tpl');
        }
    } else {
        $ppec->getContext()->smarty->assign(array('message' => $ppec->l('Error occurred:'), 'logs' => $ppec->logs, 'use_mobile' => $ppec->getContext()->getMobileDevice()));
        $display->setTemplate(_PS_MODULE_DIR_ . 'paypal/views/templates/front/error.tpl');
    }
    $display->run();
}