Post by vssoft » Sun Oct 16, 2016 1:04 pm

Hi,

How can we show our email id on Contact Us page just like contact no. Is visible. I also want the little icon of email besides email address will be shown.

I have already entered email in the admin panel but it is not visible on contact page.

Thanks

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by fido-x » Sun Oct 16, 2016 1:49 pm

vssoft wrote:I have already entered email in the admin panel but it is not visible on contact page.
That's because the purpose of the contact page is to send the email to the address entered in the admin. It isn't necessary to display the email address. Personally, I wouldn't recommend having the email address visible to the general public, as it makes it easier to be "spammed".

However, if you really want this, you can add the following code to catalog/controller/information/contact.php (around line 102):

Code: Select all

// email contact
$data['text_email'] = $this->language->get('text_email');
$data['config_email'] = $this->config->get('config_email');
// end email contact
Insert the following into catalog/language/en-gb/information/contact.php:

Code: Select all

$_['text_email'] = 'Email Address';
Then insert the following into catalog/view/theme/default/template/information/contact.tpl (below the address section around line 29):

Code: Select all

<!-- email address -->
<strong><?php //echo $text_email; ?></strong><br />
<a href="mailto: <?php echo $config_email; ?>"><i class="fa fa-envelope-o"></i> <?php echo $config_email; ?></a>
<!-- end email address -->

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by vssoft » Sun Oct 16, 2016 6:08 pm

Exactly what i want. Just change the syntax of 3rd setup for my customize theme :

Code: Select all

<?php if ($config_email) { ?>
<p class="icon_holder"><a href="mailto: <?php echo $config_email; ?><i class="fa fa-envelope-o light_color"></i> <?php echo $config_email; ?></a><i class="fa fa-envelope-o light_color"></i></p>
<?php } ?>
One more point, I want to add Telephone filed in Contact US page. Please let me know the code for the same.

Thanks,
Vishal

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm
Who is online

Users browsing this forum: No registered users and 46 guests