Thursday, December 19, 2013

Login to your OpenCart admin panel. In your browser address bar type http://yourdomain.com/admin. If you have installed your Opencart under a subfolder “store” for an example the above URL will change to http://yourdomain.com/store/admin. Login using your username and password.


We will edit footer links and copyright notification.


opencart_footer_links_1


The footer links and copyright notification should be edited in footer.tpl file which is located under /catalog/view/theme/themeXXX/template/common folder


You should edit it using any PHP/Code editor


First column is displaying Information/Content pages



<div class="column col-1">
<h3><?php echo $text_information; ?></h3>
<ul>
<?php foreach ($informations as $information) ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php ?>
</ul>
</div>

 



You can edit them in OpenCart admin panel. Navigate to Catalog > Information. Here one can edit Information/Content pages.


opencart_footer_links_2


2nd, 3rd, 4th and copyright columns are displaying links which are defined in footer.tpl file


Second column code:



<div class="column col-2"><br>
<h3><?php echo $text_service; ?></h3><br>
<ul><br>
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li><br>
<li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li><br>
<li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li><br>
</ul><br>
</div>

 



Third column code:



<div class="column col-3"><br>
<h3><?php echo $text_extra; ?></h3><br>
<ul><br>
<li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li><br>
<li><a href="<?php echo $voucher; ?>"><?php echo $text_voucher; ?></a></li><br>
<li><a href="<?php echo $affiliate; ?>"><?php echo $text_affiliate; ?></a></li><br>
<li><a href="<?php echo $special; ?>"><?php echo $text_special; ?></a></li><br>
</ul>
</div>

 



Fourth column code:



<div class="column col-4"><br>
<h3><?php echo $text_account; ?></h3><br>
<ul><br>
<li><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a></li><br>
<li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li><br>
<li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li><br>
<li><a href="<?php echo $newsletter; ?>"><?php echo $text_newsletter; ?></a></li><br>
</ul><br>
</div>

 



Copyright column code:



<div id="powered"><?php echo $powered; ?></div>

 



$text_contact, $text_return, $text_sitemap, $text_manufacturer, $text_voucher, $text_affiliate, $text_special, $text_account, $text_order, $text_wishlist, $text_newsletter and $text_powered variables are displaying the text in footer menu and defined in language files.


Store title that is displayed in footer copyright notification can be changed via the admin panel: System->Settings->Your Store Name->General tab->Store Name


Language file for the footer is called footer.php and is located in /catalog/language/english/common folder


Edit the file using any PHP/Code editor



<?php<br>
// Text<br>
$_['text_information'] = 'Information';<br>
$_['text_service'] = 'Customer Service';<br>
$_['text_extra'] = 'Extras';<br>
$_['text_contact'] = 'Contacts';<br>
$_['text_return'] = 'Returns';<br>
$_['text_sitemap'] = 'Site Map';<br>
$_['text_manufacturer'] = 'Brands';<br>
$_['text_voucher'] = 'Gift Vouchers';<br>
$_['text_affiliate'] = 'Affiliates';<br>
$_['text_special'] = 'Specials';<br>
$_['text_account'] = 'My Account';<br>
$_['text_order'] = 'Order History';<br>
$_['text_wishlist'] = 'Wish List';<br>
$_['text_newsletter'] = 'Newsletter';<br>
$_['text_powered'] = 'Powered By <a href="http://www.opencart.com">OpenCart</a> %s &copy; %s';<br>
?>

 



Here we can see all the variables which are used in footer.tpl with theirs values.


To change Contacts to Contact Us one should edit the following line of code:

$_['text_contact'] = ‘Contacts’;

and change it to

$_['text_contact'] = ‘Contact Us’;


To add external or internal link to the footer menu we should edit /catalog/view/theme/themeXXX/template/common/footer.tpl file.


E.g. to add link to http://google.com to second column we should locate the code for 2nd column in footer.tpl file



<div class="column col-2"><br>
<span style="display:block; padding:0 0 0 25px;">
<h3><?php echo $text_service; ?></h3><br>
<ul><br>
<span style="display:block; padding:0 0 0 25px;">
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li><br>
<li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li><br>
<li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li><br>
</span>
</ul><br>
</span>
</div>

 



Copy the last line of code:



<li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>

 



Add a new line and paste the code we have copied. Please edit it as follows:



<li><a href="http://google.com">Google</a></li>

 




No comments:

Post a Comment