I want to show email address on contact page in my OC 3.x. I was trying this solution but it is not working in 3.x: viewtopic.php?t=169190
Now I see page has commented all my php echo like this:
I cant add PHP inside twig files in OC 3.x?
So I was trying to do it in this way: {{ config_email }} but also does not work.
Code: Select all
<!-- <?php echo $config_email; ?> -->
So I was trying to do it in this way: {{ config_email }} but also does not work.
Cant use PHP with twig..
Backup first...
In catalog/controller/information/contact.php
find
add after
in catalog/view/theme/default/template/information/contact.twig
Place this where you want the email. You can format it as needed.
Clear your modification and theme cache.
Backup first...
In catalog/controller/information/contact.php
find
Code: Select all
$data['comment'] = $this->config->get('config_comment');
Code: Select all
$data['store_email'] = $this->config->get('config_email');
Place this where you want the email. You can format it as needed.
Code: Select all
{% if store_email %}
<a href="mailto:{{ store_email }}">{{ store_email }}</a>
{% endif %}
Backup and learn how to recover before you make any changes!
OK, my mistake. The problem was simple. I added $data for email inside if ($location_info) and in my case it's empty. I moved it right after
around line 80, and now it works.
Code: Select all
$data['comment'] = $this->config->get('config_comment');
Who is online
Users browsing this forum: No registered users and 24 guests