forked from pal/prestashop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
order-return.php
56 lines (48 loc) · 1.66 KB
/
order-return.php
1
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/* SSL Management */
$useSSL = true;
include(dirname(__FILE__).'/config/config.inc.php');
require_once(dirname(__FILE__).'/init.php');
$errors = array();
if (!$cookie->isLogged())
Tools::redirect('authentication.php?back=history.php');
if (!isset($_GET['id_order_return']) OR !Validate::isUnsignedId($_GET['id_order_return']))
$errors[] = Tools::displayError('order ID is required');
else
{
$orderRet = new OrderReturn(intval($_GET['id_order_return']));
if (Validate::isLoadedObject($orderRet) AND $orderRet->id_customer == $cookie->id_customer)
{
$order = new Order(intval($orderRet->id_order));
if (Validate::isLoadedObject($order))
{
$state = new OrderReturnState(intval($orderRet->state));
$smarty->assign(array(
'orderRet' => $orderRet,
'order' => $order,
'state_name' => $state->name[intval($cookie->id_lang)],
'return_allowed' => false,
'products' => OrderReturn::getOrdersReturnProducts(intval($orderRet->id), $order),
'returnedCustomizations' => OrderReturn::getReturnedCustomizedProducts(intval($orderRet->id_order)),
'customizedDatas' => Product::getAllCustomizedDatas(intval($order->id_cart))
));
}
else
$errors[] = Tools::displayError('cannot find this order return');
}
else
$errors[] = Tools::displayError('cannot find this order return');
}
$smarty->assign(array(
'errors' => $errors,
'nbdaysreturn' => intval(Configuration::get('PS_ORDER_RETURN_NB_DAYS'))
));
if (Tools::getValue('ajax') == 'true')
$smarty->display(_PS_THEME_DIR_.'order-return.tpl');
else
{
include(dirname(__FILE__).'/header.php');
$smarty->display(_PS_THEME_DIR_.'order-return.tpl');
include(dirname(__FILE__).'/footer.php');
}
?>