forked from pal/prestashop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdf-order-slip.php
23 lines (19 loc) · 890 Bytes
/
pdf-order-slip.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');
$cookie = new Cookie('ps');
if (!$cookie->isLogged())
Tools::redirect('authentication.php?back=order-follow.php');
if (isset($_GET['id_order_slip']) AND Validate::isUnsignedId($_GET['id_order_slip']))
$orderSlip = new OrderSlip(intval($_GET['id_order_slip']));
if (!isset($orderSlip) OR !Validate::isLoadedObject($orderSlip))
die(Tools::displayError('order return not found'));
elseif ($orderSlip->id_customer != $cookie->id_customer)
die(Tools::displayError('order return not found'));
$order = new Order(intval($orderSlip->id_order));
if (!Validate::isLoadedObject($order))
die(Tools::displayError('order not found'));
$order->products = OrderSlip::getOrdersSlipProducts(intval($orderSlip->id), $order);
$ref = NULL;
PDF::invoice($order, 'D', false, $ref, $orderSlip);
?>