Working to add a custom email that is sent to the store owner when an order is placed in OC 3.02. I have it working wonderfully, except for one piece and I think it has to do with timing. The order emails appear to go out before the order history entries are written to the order_history table. Unfortunately, I need the authorize.net info that is there.
From my testing it would appear the order of operations are:
1) Click "confirm" on the confirm order / payment info screen
2) Payment is processed if necessary (like authorize.net)
3) Order emails are dispatched
4) Order and order history tables are updated.
So, my question is this, where does the order email controller get called/triggered? I've tried a multi-file search for "mail/order", but came up empty. I essentially need to reverse steps 3 & 4 so I can get at the info in the order_history table.
From my testing it would appear the order of operations are:
1) Click "confirm" on the confirm order / payment info screen
2) Payment is processed if necessary (like authorize.net)
3) Order emails are dispatched
4) Order and order history tables are updated.
So, my question is this, where does the order email controller get called/triggered? I've tried a multi-file search for "mail/order", but came up empty. I essentially need to reverse steps 3 & 4 so I can get at the info in the order_history table.
Launched from the oc_event database table and executed into the catalog/controller/mail/order.php file to output the information in the catalog/view/theme/<your_theme>/template/mail folder.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Interesting! Never noticed that before. Looking through it I kinda get what is going on with the trigger/action columns. But what about the syntax?
To get what I need, would it be as simple as changing:
catalog/model/checkout/order/addOrderHistory/before
to
catalog/model/checkout/order/addOrderHistory/after
To get what I need, would it be as simple as changing:
catalog/model/checkout/order/addOrderHistory/before
to
catalog/model/checkout/order/addOrderHistory/after
So I tried the obvious and just changed before to after, but all that did was cause it to not send any emails at all. Must be something else that I would need to change?
What is it that you need?To get what I need, would it be as simple as changing:
catalog/model/checkout/order/addOrderHistory/before
to
catalog/model/checkout/order/addOrderHistory/after
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I need the order history to be written before I send the emails so that I can retrieve it in the email send controller.
Or at the very least I need to find a way to pass the information that would end up in the comment field to the order email controller.
Or at the very least I need to find a way to pass the information that would end up in the comment field to the order email controller.
Simply go to your relative payment controller and modify the comment text which would be way simpler. Another way would be to update the comment field in the edit() method of your catalog/controller/api/order.php file.Or at the very least I need to find a way to pass the information that would end up in the comment field to the order email controller.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I don't need to edit or modify the comment field. I need to retrieve it in the order email. Right now the order email fires before the comment is written to order_history.
I am good with the idea of passing the comment field to the order email controller, but have no clue how to pass it. Save it as a session var? I am using the authorize.net payment extension.
I am good with the idea of passing the comment field to the order email controller, but have no clue how to pass it. Save it as a session var? I am using the authorize.net payment extension.
Simply go to your relative payment controller ...
Then, the first idea is what you'd be looking for; the payment controller. In your catalog/controller/extension/payment folder, you have your authorizenet controller files. Since you didn't specified which one you were using on your last post, pick the relative file. As for the session vars, that would be correct:I am good with the idea of passing the comment field to the order email controller, but have no clue how to pass it. Save it as a session var? I am using the authorize.net payment extension.
Code: Select all
$this->session->data['comment']
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: OSWorX and 419 guests