Exemplo n.º 1
0
 public function __construct()
 {
     $this->paypal = new PayPal();
     $this->context = Context::getContext();
     parent::__construct();
     $this->run();
 }
Exemplo n.º 2
0
 public function __construct()
 {
     /** Backward compatibility */
     include_once _PS_MODULE_DIR_ . '/paypal/backward_compatibility/backward.php';
     $this->context = Context::getContext();
     parent::__construct();
 }
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign(array('is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()));
     $order = new Order((int) $this->id_order);
     if ($this->context->customer->is_guest) {
         $this->context->smarty->assign(array('name' => $this->context->customer->firstname . ' ' . $this->context->customer->lastname, 'id_order' => $this->id_order, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email, 'amount' => $order->total_paid));
         /* If guest we clear the cookie for security reason */
         $this->context->customer->mylogout();
     } else {
         $this->context->smarty->assign(array('id_order' => $this->id_order, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'name' => $this->context->customer->firstname, 'amount' => $order->total_paid));
     }
     $order = new Order($this->id_order);
     $products = $order->getProducts();
     $this->context->smarty->assign(array('order' => $order, 'products' => $products));
     $this->setTemplate(_PS_THEME_DIR_ . 'order-confirmation.tpl');
 }