Hi,
I try with below code and i was able to show customer email on order success page but was displaying on random place.
in success.php
if (isset($this->ses
sion->data['guest'])) {
$data['customer_email'] = $this->session->data['guest']['email']; // Guest user's email
} elseif($this->customer->isLogged()) {
$data['customer_email'] = $this->customer->getEmail(); // Customer's email
}
in success.twig
{% if (customer_email is defined) %}
<input name="email" type="hidden" value="{{ customer_email }}">
{% endif %}
i using a custom checkout success message text to cannot it at desired place.
any can help me about how to use sprintf function to display it at desired place.
No OC version posted. Although, you do not need to use sprintf to display the email address since you are already using the $data['customer_email'] and the {{ customer_email }} variable.
However, if you'd add a text definition into the success language file, it would be for example:
Then, in your success.twig file: {{ text_email_success }}
However, if you'd add a text definition into the success language file, it would be for example:
Code: Select all
$data['text_email_success'] = sprintf($this->language->get('text_email_success'), html_entity_decode($data['customer_email'], ENT_QUOTES, 'UTF-8'));
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Look in the error logs regarding the white page. Your displayed error logs are not currently enabled on your server. You can also enforce the display errors from Opencart by following this topic: viewtopic.php?f=190&t=201899&p=713113#p713113
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: Bing [Bot], niagato and 428 guests