public function renderView() { if (!isset($_SESSION['cart'])) { $cart = new Cart(); $_SESSION['cart'] = serialize($cart); } foreach ($this->model->getUris() as $key => $value) { if (preg_match("#^{$value}\$#", $this->uriView)) { if ($this->model->getView($key) === "PageView") { $pagecontroller = new PageController($this->additionalParam); $pagecontroller->renderView(); } else { if ($this->model->getView($key) === "ProductView") { $productscontroller = new ProductsController(); $productscontroller->renderView(); } else { if ($this->model->getView($key) === "SingleProductView") { $singleproductcontroller = new SingleProductController($this->additionalParam); $singleproductcontroller->renderView(); } else { if ($this->model->getView($key) === "LoginView") { $logincontroller = new LoginController($this->additionalParam); $logincontroller->renderView(); } else { if ($this->model->getView($key) === "CustomerView") { $customercontroller = new CustomerController(); $customercontroller->renderView(); } else { if ($this->model->getView($key) === "CartView") { $cartcontroller = new CartController($this->additionalParam); $cartcontroller->renderView(); } else { if ($this->model->getView($key) === "ContactView") { $contactcontroller = new ContactController($this->additionalParam); $contactcontroller->renderView(); } else { if ($this->model->getView($key) === "RegisterView") { $registrationcontroller = new RegistrationController($this->additionalParam); $registrationcontroller->renderView(); } else { if ($this->model->getView($key) === "CheckoutView") { $checkoutcontroller = new CheckoutController($this->additionalParam); $checkoutcontroller->renderView(); } else { $useView = $this->model->getView($key); $view = new $useView(); $view->render(); } } } } } } } } } } } }
/** returns the url of the checkout or null if there is a error */ public function goToCheckout($sizeID, $appearance) { $sizes = $this->productType->getSizes(); if (isset($sizes[$sizeID])) { // echo "size :".$sizes[$sizeID]; // echo "appearance :".$this->product->getDefaultAppearanceID(); $checkout = new CheckoutController(); if ($this->useShopCheckout) { return $checkout->checkout($this->article, $this->shopID, $sizeID, $this->product->getDefaultAppearanceID()); } else { return $checkout->checkout($this->article, NULL, $sizeID, $this->product->getDefaultAppearanceID()); } } return NULL; }
<?php /** * Created by PhpStorm. * User: Home * Date: 11.11.2015 * Time: 20:08 */ include_once $_SERVER['DOCUMENT_ROOT'] . '/Controllers/CheckoutController.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/Model/CheckoutModel.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/View/CheckoutView.php'; $model = new CheckoutModel(); $controller = new CheckoutController($model); $view = new CheckoutView($model); session_start(); if (!isset($_SESSION['admin'])) { header('Location: /admin/login'); } session_write_close(); if (isset($_POST['done'])) { $controller->actionDone('completeorders', 'doneorders'); } else { if (isset($_POST['pull-back'])) { $controller->actionDone('doneorders', 'completeorders'); } else { $view->DoctypeView('Admin'); $controller->actionGetData('completeorders'); $view->getTable('latest'); $controller->actionGetData('doneorders'); $view->getTable('done'); }
/** * Make payment for unpaid or partially paid order * @role login */ public function pay() { $this->loadLanguageFile('Checkout'); $this->addAccountBreadcrumb(); $this->addBreadCrumb($this->translate('_pay'), ''); $order = $this->getOrder($this->request->get('id')); if (!$order || $order->isPaid->get()) { return new ActionRedirectResponse('user', 'index'); } $response = new ActionResponse(); $response->set('order', $order->toArray(array('payments' => true))); $response->set('id', $order->getID()); $checkout = new CheckoutController($this->application); $checkout->setPaymentMethodResponse($response, $order); return $response; }
private function _GooglePay() { Config::GetInstance()->InitSession(); $payment = new CheckoutController(); $msg = $payment->DoGoogleCheckout(); if (!empty($msg)) { FormPage::GetInstance()->SetErrors(array(array('field' => 'Form', 'err' => $msg))); } }
protected function validateOrder(CustomerOrder $order, $step = 0) { return !$this->ignoreValidation ? parent::validateOrder($order, $step) : false; }
protected function validateOrder(CustomerOrder $order, $step = 0) { if ($this->config->get('REQUIRE_SAME_ADDRESS') && !$order->billingAddress->get()) { $order->billingAddress->set($order->shippingAddress->get()); $tempBilling = true; } $res = !$this->ignoreValidation ? parent::validateOrder($order, $step) : false; if (!empty($tempBilling)) { $order->billingAddress->setNull(); } return $res; }
function PrepareConfirmPage() { $this->source = Config::GetInstance()->GetConfig('settings', 'redirect_settings', 'confirmpage'); if (empty($this->source)) { $this->source = false; return; } else { if (empty($this->post)) { return; } } if (Config::GetInstance()->UsePayments()) { // restore cart data from session Config::GetInstance()->InitSession(); $payment = new CheckoutController(); MessagePostMerger::GetInstance()->cart = $payment->getCartInstance(); MessagePostMerger::GetInstance()->setDecimals(Config::GetInstance()->GetConfig('settings', 'payment_settings', 'decimals')); } $this->source = MessagePostMerger::GetInstance()->SubstituteFieldNames($this->source); }