Two issues:
1) How can I receive an exact copy of the order confirmation email that is sent to the customer?
2) The order alert sent to the shop owner does not even contain customer name or email address. I tried to alter order_alert.twig but have not been successfull so far. I went to the controler file "order.php" to see how data is passed into the twig-file and found the $data-array. For instance:
$data['order_id'] = ...;
$data['email'] = ... ;
Within the twig-file {{ order_id }} prints the order id.
Copying {{ order_id }} within the twig-file will simply print me the same order id again. BUT: {{ email }} (not used within the order_alert.twig so far) will print nothing. In fact, I can copy any field within the twig-file that is already available in the code and it will print the respective value again but I cannot add any new field.
I access the twig-file via a FTP-connection (tried the template editow: same issue). Once done editing, I clear the server cache within opencart through the button provided on the dashboard.
By the way: I just installed a fresh version of OC and tried the above: Same issue!
Hopefully someone can help me here.
Cheerz!
Mike
What does this explain to forum posters in order to gather the proper solution exactly?$data['email'] = ... ;
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Here you go:
As I said, I was checking "order.php" to see which variables (apart from those already used in "order_alert.twig") are available.
I found "$data['order_id'] = $order_info['order_id'];" in "order.php" and I found {{ order_id }} in "order_alert.twig". Thus, I tried to use another simple varibale and went for "$data['email'] = $order_info['email'];". I inserted {{ email }} into "order_alert.twig" but the respective mail sent to my account did not contain the email address. In fact, it contained nothing new. So I simply copy/pasted {{ order_id }} to see if changes to the "order_alert.twig" file are noted/processed at all. And they are: The email I received contained the respective order ID twice.
If I copy/paste variables which are already used in "order_alert.twig", everything works as expected.
Using any other varible available within the $data-array in "order.php" and putting {{ VAR_NAME }} into the twig file does not work, though.
Does this help?
If not, I can elaborate even more.
Thanks for your time!
More information would be needed.adamharrisuk wrote: ↑Mon Jan 08, 2018 5:50 pmI'm also looking to change the admin confirmation email! The standard one is pretty useless.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Then, you would also need to provide more information based on this inquiry.enduroforum wrote: ↑Fri Jan 12, 2018 5:50 amI think an answer to my original issues would also be helpful for what adamharrisuk is looking for.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
The exact variables of your codes with their values or the attachment file that shows your modifications.enduroforum wrote: ↑Fri Jan 12, 2018 8:01 amSee my post #9: What kind of additional information are you looking for with respect to my initial question/enquery/problem?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
{{ text_received }}
{{ text_order_id }} {{ order_id }}
{{ text_date_added }} {{ date_added }}
{{ text_order_status }} {{ order_status }}
Code found in \opencart\catalog\controller\mail\order.php
Line 101: $data['order_id'] = $order_info['order_id'];
Line 105: $data['email'] = $order_info['email'];
Edited \opencart\catalog\view\theme\default\template\mail\order_alert.twig
{{ text_received }}
{{ text_order_id }} {{ order_id }}
{{ text_order_id }} {{ order_id }}
{{ email }}
{{ text_date_added }} {{ date_added }}
{{ text_order_status }} {{ order_status }}
The edited "order_alert.twig" returns the order ID twice but does not give the email address.
Thus, as I said before: If I copy/paste variables which are already used in "order_alert.twig", everything works as expected.
Using any other varible available within the $data-array in "order.php" and putting {{ VAR_NAME }} into the twig file does not work.
Please let me know if you need more Information to help me with this.
Thanks.
At this lines did you added these entries in the controllers and under which method name?Code found in \opencart\catalog\controller\mail\order.php
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
If there is anything else I need to do in order to add additonal fields to the order confirmation mail, kindly let me know.
What you did is also indicating this portion of the code but did not mentioned where exactly in the mail/order.php file you did added those lines.Code found in \opencart\catalog\controller\mail\order.php
Line 101: $data['order_id'] = $order_info['order_id'];
Line 105: $data['email'] = $order_info['email'];
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
It's nothing I added. Opencart contains this code within order.php.
To rectify this, in your catalog/controller/mail/order.php file, in the alert(&$route, &$args) { method,
find:
Code: Select all
$data['order_id'] = $order_info['order_id'];
Code: Select all
$data['text_email'] = $language->get('text_email');
$data['email'] = $order_info['email'];
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Adding these lines does not change a thing. :-(
I cleared all cashed afterwards.
See my other problem with the shopping cart: viewtopic.php?f=202&t=200989
Seems to be the same issue: No matter what I change, issues remain.
after:
Code: Select all
<?php
Code: Select all
echo 'test123';
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Editing these files should be so freaking easy!?
I removed OC 3.0.2.0 since no code adjustments within any PHP file were reflected. I even tried this on a freshly installed instance: Same issues. Not even the "your cart is empty"-bug could be remediated.
So, I am now runing on OC 3.0.1.1. At least this version does not have the "your cart is empty"-bug (hurray!).
Still, though, changes to the PHP files seem to be ignored:
- I went to "\catalog\controller\mail\order.php" and inserted:
Code: Select all
$data['text_email'] = $language->get('text_email');
$data['email'] = $order_info['email'];
Code: Select all
{{ text_email }} {{ email }}
In addition, I went to "\catalog\controller\account\account.php" and removed:
Code: Select all
$data['newsletter'] = $this->url->link('account/newsletter', '', true);
Guess what!? Nothing changed!
Am I really the only one who is having such problems?
I generally agree that the root cause of errors sits mostly between the keyboard and the chair... but as I said: I am running a fresh version of OC.
Could this be a caching problem? Something else I noted just today:
- I add an item to my cart
- The button on the top right side of the page instantly changes and reflects the respective amount
- I click on this button, a box opens and click on the cross behind the item in order to remove this item from the cart.
- The box closes and the button does not show any amount.
- I click on the button, a box opens and I DO SEE the item I actually removed.
- Actually going to my cart reveales that the cart is empty.
Sounds like a caching issue to me.
Users browsing this forum: No registered users and 220 guests