Post by magisterson » Sun Dec 08, 2019 4:36 am

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

New member

Posts

Joined
Tue Jul 23, 2013 10:15 pm

Post by cyclops12 » Sun Dec 08, 2019 4:40 am

What do you mean not working what is happening?

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by magisterson » Sun Dec 08, 2019 4:44 am

cyclops12 wrote:
Sun Dec 08, 2019 4:40 am
What do you mean not working what is happening?
Nothing shows. Maybe in OC 3 store e-mail has different variables name or something?

New member

Posts

Joined
Tue Jul 23, 2013 10:15 pm

Post by magisterson » Sun Dec 08, 2019 5:01 am

Now I see page has commented all my php echo like this:

Code: Select all

<!-- <?php echo $config_email; ?> -->
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.

New member

Posts

Joined
Tue Jul 23, 2013 10:15 pm

Post by sw!tch » Sun Dec 08, 2019 5:08 am

Cant use PHP with twig..

Backup first...

In catalog/controller/information/contact.php
find

Code: Select all

$data['comment'] = $this->config->get('config_comment');
add after

Code: Select all

$data['store_email'] = $this->config->get('config_email');
in catalog/view/theme/default/template/information/contact.twig
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 %}
Clear your modification and theme cache.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by magisterson » Sun Dec 08, 2019 5:19 am

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

Code: Select all

$data['comment'] = $this->config->get('config_comment');
around line 80, and now it works.

New member

Posts

Joined
Tue Jul 23, 2013 10:15 pm
Who is online

Users browsing this forum: No registered users and 24 guests