This is important for me, because our local laws require invoice number to be present at bank transfer details as a payment reason. Please help me in passing invoice_no value to order_add.twig .
Laptop repair specialist in Sofia, Bulgaria.
Maintaining own OC 3 shop for laptop screens
Would you please be so kind as to read the forum rules before posting viewtopic.php?f=176&t=200480. In particular please always post your OC version using all four digits. You can find this at the bottom of every admin page.
This is out of the scope of free support you can find there is a commercial section where many people will respond to quote. Have you checked with the extension developer?
Even if we were to want to help, it would depend on where and when that extension generates and stores the invoice number.
The email is send just before the order history is written by the payment method(s) controller which is just before the success page is shown.
If the invoice number is generated and stored before the sending of the email (when the order is stored for instance) you can do this:
in catalog/controller/mail/order.php
you can add:
Code: Select all
$data['invoice_no'] = $order_info['invoice_no'];
Code: Select all
$data['order_id'] = $order_info['order_id'];
add:
Code: Select all
{{ invoice_no }}
if the invoice number is generated and stored after the email is send, then no such luck.
You can find the commercial section here : viewforum.php?f=88
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
https://hpwebdesign.io/hp-professional- ... r-opencart
HP Web Design
http://hpwebdesign.io
Opencart Extension Development | OpenCart Professional Services | OpenCart Tutorials
I am sorry for forgetting about the exact version - it is 3.0.3.2.
Your proposed solution outputs "0" as an invoice number. Obviously it is generated later, and I am not familiar with consequence of procedures in Opencart. At least now I know that /catalog/controller/mail/order.php loads data to add_order.twig . It is a good point to start
P.S.: I have just added:
Code: Select all
$data['invoice_no'] = $this->model_checkout_order->createInvoiceNo($order_info['order_id']);
where you proposed. The function "createInvoiceNo" is a part of "Auto Invoice Number" extension and now it generates the number at mail/order.php . Thank you again, by mona! You gave me the clue that I've been searching for.
Laptop repair specialist in Sofia, Bulgaria.
Maintaining own OC 3 shop for laptop screens
By using an Event, this could be accomplished: https://github.com/opencart/opencart/wiki/Events-Systemilian359 wrote: ↑Sat Nov 27, 2021 4:27 amThank you, by mona!
I am sorry for forgetting about the exact version - it is 3.0.3.2.
Your proposed solution outputs "0" as an invoice number. Obviously it is generated later, and I am not familiar with consequence of procedures in Opencart. At least now I know that /catalog/controller/mail/order.php loads data to add_order.twig . It is a good point to start
P.S.: I have just added:Code: Select all
$data['invoice_no'] = $this->model_checkout_order->createInvoiceNo($order_info['order_id']);
where you proposed. The function "createInvoiceNo" is a part of "Auto Invoice Number" extension and now it generates the number at mail/order.php . Thank you again, by mona! You gave me the clue that I've been searching for.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 517 guests