-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExtIsotopeInvoice.php
54 lines (45 loc) · 1.75 KB
/
ExtIsotopeInvoice.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
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/**
* PHP version 5
* @copyright Copyright (C) 2013 Kirsten Roschanski
* @author Kirsten Roschanski <[email protected]>
* @license http://opensource.org/licenses/lgpl-3.0.html
*/
/**
* Class ExtIsotopeInvoice
*
* @copyright Copyright (C) 2013 Kirsten Roschanski
* @author Kirsten Roschanski <[email protected]>
* @package IsotopeInvoice
* @filesource https://github.com/katgirl/isotope_invoice
*/
class ExtIsotopeInvoice extends Model
{
/**
* Initialize the object
*/
public function __construct()
{
parent::__construct();
$this->import('Isotope');
}
/**
* New parameter for TemplateObject
*/
public function getGenerateCollection(&$objTemplate, $arrItems, IsotopeProductCollection $objProductCollection)
{
if ( ! preg_match("/iso_invoice/", $objTemplate->getName() ) )
{
return;
}
$objTemplate->invoiceTitle = $GLOBALS['TL_LANG']['isoInvoice']['iso_invoice_title'];
$objTemplate->orderIdLabel = $GLOBALS['TL_LANG']['isoInvoice']['orderIdLabel'];
$objTemplate->orderId = $objProductCollection->order_id;
$objTemplate->orderDateLabel = $GLOBALS['TL_LANG']['isoInvoice']['orderDateLabel'];
$objTemplate->orderDate = date($GLOBALS['TL_CONFIG']['dateFormat'], $objProductCollection->date);
$objTemplate->arrBillingAddress = $objProductCollection->billing_address;
$objTemplate->arrShippingAddress = $objProductCollection->shipping_address ? $objProductCollection->shipping_address : $objProductCollection->billing_address;
// Switch Template
$objTemplate->setName($this->Isotope->Config->invoice_template);
}
}