60 lines
1.6 KiB
PHP
Executable File
60 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
class OrderConfirmationController extends OrderConfirmationControllerCore {
|
|
|
|
public function preProcess() {
|
|
// Fix delay after Paymeny Paybox for create Order
|
|
$this->id_module = (int)(Tools::getValue('id_module', 0));
|
|
if($this->id_module == 94) {
|
|
sleep(5);
|
|
}
|
|
|
|
parent::preProcess();
|
|
|
|
$order = new Order($this->id_order);
|
|
$products = $order->getProducts();
|
|
foreach ($products as $product) {
|
|
$productIds[] = (int) $product['product_id'];
|
|
}
|
|
|
|
self::$smarty->assign(
|
|
array(
|
|
'order' => $order,
|
|
'productIds' => $productIds,
|
|
'currency' => Currency::getCurrency((int) $order->id_currency),
|
|
)
|
|
);
|
|
}
|
|
|
|
public function displayContent() {
|
|
$customer = Context::getContext()->customer;
|
|
|
|
$order = new Order($this->id_order);
|
|
$products = $order->getProducts();
|
|
$address_delivery = new Address($order->id_address_delivery);
|
|
$address_invoice = new Address($order->id_address_invoice);
|
|
|
|
foreach ($products as $key => $product) {
|
|
$cover = Product::getCover((int) $product['product_id']);
|
|
$products[$key]['id_image'] = $cover['id_image'];
|
|
}
|
|
|
|
// assign delay to Products
|
|
if (Module::isInstalled('privatesales_delay')) {
|
|
require_once _PS_ROOT_DIR_.'/modules/privatesales_delay/saledelay.php';
|
|
$products = SaleDelay::associateDelay($products);
|
|
}
|
|
|
|
self::$smarty->assign(
|
|
array(
|
|
'customer' => $customer,
|
|
'order' => $order,
|
|
'address_delivery' => $address_delivery,
|
|
'address_invoice' => $address_invoice,
|
|
'products' => $products
|
|
)
|
|
);
|
|
self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl');
|
|
}
|
|
|
|
} |