Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class AdminOrdersController extends AdminOrdersControllerCore
- {
- public function __construct()
- {
- parent::__construct();
- //BulkActions
- $this->bulk_actions['divider2'] = array('text' => 'divider');
- $this->bulk_actions['printInvoices'] = array('text' => $this->l('Download Invoice'), 'icon' => 'icon-file-text');
- $this->bulk_actions['printDeliverySlips'] = array('text' => $this->l('Download Delivery Slip'), 'icon' => 'icon-truck');
- }
- //processBulkUpdateOrderStatus
- protected function processBulkPrintInvoices()
- {
- $id_orders = implode(',', Tools::getValue('orderBox'));
- //ddd($id_orders);
- $order_invoice_collection = OrderInvoice::getByOrderIdBulk($id_orders);
- if (!count($order_invoice_collection)) {
- die(Tools::displayError('No invoice was found.'));
- }
- //Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice)))
- $pdf = new PDF($order_invoice_collection, PDF::TEMPLATE_INVOICE, Context::getContext()->smarty);
- $pdf->render();
- }
- protected function processBulkPrintDeliverySlips()
- {
- $id_orders = implode(',', Tools::getValue('orderBox'));
- //ddd($id_orders);
- $order_invoice_collection = OrderInvoice::getByOrderIdBulk($id_orders);
- if (!count($order_invoice_collection)) {
- die(Tools::displayError('No invoice was found.'));
- }
- //Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice)))
- $pdf = new PDF($order_invoice_collection, PDF::TEMPLATE_DELIVERY_SLIP, Context::getContext()->smarty);
- $pdf->render();
- }
- }
Add Comment
Please, Sign In to add comment