1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
32:
33: 34: 35:
36: class dpdcodpaymentPaymentModuleFrontController extends ModuleFrontController {
37:
38: public $ssl = true;
39:
40: 41: 42:
43: public function initContent() {
44:
45: $this->display_column_left = true;
46:
47: $cart = $this->context->cart;
48: $moduleParams = array('cart' => $cart);
49: if (!$this->module->checkCurrency($cart) || !$this->module->isAvailable($moduleParams)) {
50: Tools::redirect('index.php?controller=order');
51: exit;
52: }
53:
54:
55: $module = array(
56: '_title' => $this->module->getCurrentLangValue($this->module->getConfigData('TITLE')),
57: '_extra' => '',
58: '_text' => $this->module->getCurrentLangValue($this->module->getConfigData('INFO_TEXT')),
59: );
60:
61:
62: $cart->codFee = $this->module->getCodFee($cart);
63:
64:
65:
66: $summary = $cart->getSummaryDetails();
67:
68: $products = $summary['products'];
69: $total_shipping = $summary['total_shipping'];
70: $total_price = $summary['total_price'];
71: $total_products = $summary['total_products'];
72:
73:
74: parent::initContent();
75: $pickupLocationModuleParams = array(
76: 'eabi_template' => '%TERMINAL%',
77: );
78:
79:
80: $pickup_location = HookCore::exec('displayOrderConfirmation', $pickupLocationModuleParams, ModuleCore::getModuleIdByName('eabi_postoffice'));
81:
82:
83: $this->context->smarty->assign(array(
84: 'eabi_summary' => array(
85: 'products' => $products,
86: 'total_shipping' => $total_shipping,
87: 'total_products' => $total_products,
88: 'total_price' => $total_price,
89: 'currency' => CurrencyCore::getCurrency($cart->id_currency),
90: 'cod_fee' => $cart->codFee,
91: 'cod_fee_formatted' => Tools::displayPrice($cart->codFee),
92: 'template' => $this->getTemplatePath('').'order-detail.tpl',
93: 'pickup_location' => $pickup_location,
94: ),
95: 'nbProducts' => $cart->nbProducts(),
96: 'cust_currency' => $cart->id_currency,
97: 'currencies' => $this->module->getCurrency((int) $cart->id_currency),
98: 'total' => $cart->getOrderTotal(true, Cart::BOTH),
99: 'this_path' => $this->module->getPathUri(),
100: 'current_module' => $module,
101: 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'
102: ));
103: if ($this->module->ver == "1.5") {
104: $this->setTemplate('payment_exec.tpl');
105: } else {
106: $this->setTemplate('payment_execution.tpl');
107:
108: }
109:
110:
111: }
112:
113: }