Page 1 of 1

Clone for invoice.twig

Posted: Sun Dec 05, 2021 9:24 pm
by opencart-modul
Can I make this functionality as below:

Print Invoice Button -> order_invoice.twig
Add New Button Print Diffrent Button -> order_invoice2.twig


I have tried creating another order_invoice2.twig in admin\view\template\sale
and

Code: Select all

admin/controller/sale/order.php 

202 line -     
$data['invoice'] = $this->url->link('sale/order/invoice', 'user_token=' . $this->session->data['user_token'], true);
$data['invoice2'] = $this->url->link('sale/order/invoice2', 'user_token=' . $this->session->data['user_token'], true);

785 line - 
$data['invoice'] = $this->url->link('sale/order/invoice', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . (int)$this->request->get['order_id'], true);
$data['invoice2'] = $this->url->link('sale/order/invoice2', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . (int)$this->request->get['order_id'], true);

admin\view\template\sale\order_list.twig

button type="submit" id="button-invoice" form="form-order" formaction="{{ invoice }}" formtarget="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa fa-print"></i></button>

<button type="submit" id="button-invoice2" form="form-order" formaction="{{ invoice2 }}" formtarget="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa fa-print"></i></button>
ERROR:
Page Not Found!

Please Help Me

Re: Clone for invoice.twig

Posted: Sun Dec 05, 2021 10:05 pm
by grgr
If that is the entirety of your code then you are missing the function, hence the 404.

Code: Select all

public function invoice2() {