39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
class CaratyOkModuleFrontController extends ModuleFrontController {
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function postProcess() {
|
|
if (empty($_GET['orderNumber'])) {
|
|
try {
|
|
Tools::redirect(
|
|
'index.php?controller=order-confirmation&id_cart=' . (int)$cart->id
|
|
. '&id_module=' . (int)$this->module->id
|
|
. '&id_order=' . $this->module->currentOrder
|
|
. '&key=' . $customer->secure_key
|
|
);
|
|
} catch (Exception $e) {
|
|
}
|
|
|
|
die();
|
|
}
|
|
|
|
$context = Context::getContext();
|
|
$order = new Order(intval($_GET['orderNumber']));
|
|
if ($order->id_customer == $context->cookie->id_customer) {
|
|
$order->setCurrentState(Configuration::get('PAYMENT_FINISH'));
|
|
}
|
|
|
|
$customer = new Customer($order->id_customer);
|
|
|
|
Tools::redirect(
|
|
'index.php?controller=order-confirmation&id_cart=' . (int)$order->id_cart
|
|
. '&id_module=' . (int)$this->module->id
|
|
. '&id_order=' . $this->module->currentOrder
|
|
. '&key=' . $customer->secure_key
|
|
);
|
|
}
|
|
}
|