Post by toothless3010 » Thu Nov 16, 2017 1:00 pm

Hi guys,

using the OpenCart 1.5.6.1, I was assigned to add a PDF file download link in the footer for a website. Im still new to this OpenCart environment having to be underpressure learning how OpenCart works and suddenly a task is assigned for me. I need help. I already uploaded the downloadable PDF in the download folder in the root folder. If any kind souls would help me to teach how do I add the link in the footer of my website that will be very very helpful for me today. Looking at the codes that has been made I spent too much time to try to figure out and my brain is fried.

/catalog/view/theme/megastore/template/common/footer.tpl

Code: Select all

<p class="clear" style="height:20px"></p>
	
	<!-- Footer -->

	<div id="footer">
	
	<?php 
	
	$customfooter = $this->config->get('customfooter');
	
	if(isset($customfooter[$language_id])) { 
	
		if($customfooter[$language_id]['twitter_status'] == '1' || $customfooter[$language_id]['contact_status'] == '1' || $customfooter[$language_id]['aboutus_status'] == '1' || $customfooter[$language_id]['facebook_status'] == '1') {
		
$grids = 12; $test = 0;  if($customfooter[$language_id]['contact_status'] == '1' || $customfooter[$language_id]['aboutus_status'] == '1') { $test++; } if($customfooter[$language_id]['twitter_status'] == '1') { $test++; } if($customfooter[$language_id]['facebook_status'] == '1') { $test++; } $grids = 12/$test;
	
	?>	
		
		<!-- Separator --><p class="border"></p>
		
		<!-- Footer top outside -->
		
		<div class="footer-top-outside set-size">
		
			<?php if($customfooter[$language_id]['contact_status'] == '1' || $customfooter[$language_id]['aboutus_status'] == '1') { ?>
		
			<!-- About Us -->
			
			<div class="grid-<?php echo $grids; ?> float-left">

				
				<?php if($customfooter[$language_id]['aboutus_status'] == '1') { ?>
				
				<?php if($customfooter[$language_id]['aboutus_title'] != '') { ?>
				<h2><?php echo $customfooter[$language_id]['aboutus_title']; ?></h2>
				<?php } ?>
				
				<p align="justify"><font color="#818181">
				
					<?php echo html_entity_decode($customfooter[$language_id]['aboutus_text']); ?>
					
				</font></p>
				
				<?php } ?>
				
				<?php if($customfooter[$language_id]['contact_status'] == '1') { ?>
				
				<ul id="contact-us">

					<li>

						<?php if($customfooter[$language_id]['contact_phone'] != '') { ?>
						<ul id="tel"><li><?php echo $customfooter[$language_id]['contact_phone']; ?></li></ul>
						<?php } ?>
						<?php if($customfooter[$language_id]['contact_email'] != '') { ?>
						<ul id="mail"><li><?php echo $customfooter[$language_id]['contact_email']; ?></li></ul>
						<?php } ?>
						<?php if($customfooter[$language_id]['contact_skype'] != '') { ?>
						<ul id="skype"><li><?php echo $customfooter[$language_id]['contact_skype']; ?></li></ul>
						<?php } ?>

					</li>

				</ul>
				
				<?php } ?>
			
			</div>
			
			<!-- End About Us -->
			
			<?php } ?>
			
			<?php if($customfooter[$language_id]['twitter_status'] == '1') { ?>
			
			<!-- Twitter -->
			
			<div class="grid-<?php echo $grids; ?> float-left">
			
				<!-- ***** TWITTER API INTEGRATION STARTS HERE ***** -->
				<script type="text/javascript">
					jQuery(function($){
						$(".tweet").tweet({
							username: "<?php echo $customfooter[$language_id]['twitter_profile'] ; ?>",
							join_text: "auto",
							avatar_size: 0,
							count: 3,
							auto_join_text_default: "<b>:</b>",
							auto_join_text_ed: "<b>:</b>",
							auto_join_text_ing: "<b>:</b>",
							auto_join_text_reply: "<b>:</b>",
							auto_join_text_url: "<b>:</b>",
							loading_text: "Loading tweets..."
						});
					});
				</script> 
				<!-- ***** TWITTER API INTEGRATION ENDS HERE ***** -->
			
				<h2>Twitter</h2>
			
				<div id="twitter-updates"><div class="tweet"></div></div>
							
			</div>
			
			<!-- End twitter -->
			
			<?php } ?>
			
			<?php if($customfooter[$language_id]['facebook_status'] == '1') { ?>
			
			<!-- Facebook -->
			
			<div class="grid-<?php echo $grids; ?> float-left" id="facebook">
				
				<?php $facebook_css = ''.HTTP_SERVER.'catalog/view/theme/megastore/stylesheet/facebook.css.php';?>
							
				<h2>Facebook</h2>
				
				<!-- Facebook -->
				
				<div class="fb-like-box" data-href="http://www.facebook.com/kuckreja" data-width="400" data-height="220" data-show-												
                                 faces="true" data-stream="false" data-header="true" style="background-color:#ffffff;"></div>
															
				<!-- End Facebook -->
						
			
			</div>
			
			<!-- End facebook -->
			
			<?php } ?>
		
			<p class="clear"></p>
		
		</div>
		
		<!-- End footer top outside -->
		
		<?php } } ?>
		
		<!-- Separator --><p class="border"></p>
		
		<!-- Footer Navigation -->
		
		<div class="set-size footer-navigation">
				
			<?php if ($informations) { ?>
		    <div class="grid-3 float-left">
				
		      <h3><?php echo $text_information; ?></h3>

		      <ul class="no-active">

			      <?php foreach ($informations as $information) { ?>
			      <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
			      <?php } ?>
			
		      </ul>

		    </div>
			 <?php } ?>
			 
		    <div class="grid-3 float-left">

		      <h3><?php echo $text_service; ?></h3>

		      <ul class="no-active">

			      <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
			      <li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li>
			      <li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>

		      </ul>

		    </div>

		    <div class="grid-3 float-left">

		      <h3><?php echo $text_extra; ?></h3>

		      <ul class="no-active">

			      <li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li>
			      <li><a href="<?php echo $voucher; ?>"><?php echo $text_voucher; ?></a></li>
			      <!-- <li><a href="<?php echo $affiliate; ?>"><?php echo $text_affiliate; ?></a></li> -->
			      <li><a href="<?php echo $special; ?>"><?php echo $text_special; ?></a></li>
				 
		      </ul>

		    </div>

		    <div class="grid-3 float-left">

				<h3><?php echo $text_account; ?></h3>

		    	<ul class="no-active">
		    	
			      <li><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a></li>
			      <li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li>
			      <li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>
			      <li><a href="<?php echo $newsletter; ?>"><?php echo $text_newsletter; ?></a></li>

		    	</ul>

			</div>
			
			<p class="clear"></p>
		
		</div>
		
		<!-- End footer navigation -->
		
		<!-- Separator --><p class="border"></p>
		
		<!-- Copyright -->
		
		<div class="copyright set-size">
			
			<?php if($this->config->get('payment_status') != '0') { ?>
			<ul>
				
				<?php if($this->config->get('payment_mastercard_status') != '0') { ?>
				<?php if($this->config->get('payment_mastercard') != '') { ?>
				<li><img src="<?php echo $this->config->get('payment_mastercard'); ?>" alt="Mastercard" /></li>
				<?php } else { ?>
				<li><img src="catalog/view/theme/megastore/images/mastercard.png" alt="Mastercard" /></li>
				<?php } ?>
				<?php } ?>
				<?php if($this->config->get('payment_visa_status') != '0') { ?>
				<?php if($this->config->get('payment_visa') != '') { ?>
				<li><img src="<?php echo $this->config->get('payment_visa'); ?>" alt="Visa" /></li>
				<?php } else { ?>
				<li><img src="catalog/view/theme/megastore/images/visa.png" alt="Visa" /></li>
				<?php } ?>
				<?php } ?>
				<?php if($this->config->get('payment_moneybookers_status') != '0') { ?>
				<?php if($this->config->get('payment_moneybookers') != '') { ?>
				<li><img src="<?php echo $this->config->get('payment_moneybookers'); ?>" alt="MoneyBookers" /></li>
				<?php } else { ?>
				<li><img src="catalog/view/theme/megastore/images/moneybookers.png" alt="MoneyBookers" /></li>
				<?php } ?>
				<?php } ?>
				<?php if($this->config->get('payment_paypal_status') != '0') { ?>
				<?php if($this->config->get('payment_paypal') != '') { ?>
				<li><img src="<?php echo $this->config->get('payment_paypal'); ?>" alt="Paypal" /></li>
				<?php } else { ?>
				<li><img src="catalog/view/theme/megastore/images/paypal.png" alt="PayPal" /></li>
				<?php } ?>
				<?php } ?>
			
			</ul>
			<?php } ?>
			
			<p><font color="#dcdcdc">Copyright © Kuckreja</font> | <a style="color:#dcdcdc;" href="http://www.bikebear.com.my">Web Design 
                          Company</a> | <a style="color:#dcdcdc;" href="http://EzraPlusPhotography.com">EzraPlusPhotography</a> </p>
			
			<div class="clear"></div>
		
		</div>
		
		<!-- End copyright -->

	</div>

	<!-- End footer -->
	
</div>

<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init(100709270); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/100709270ns.gif" /></p></noscript>

</body>
</html>
<script type="text/javascript">
jQuery(document).ready(function() {
    // Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	jQuery('.carousel').jcarousel({
		scroll     : 2,
		auto       : 7,
		wrap       : 'both',
		animation  : 'slow',
		ease       : 'easein'
	});	
});
</script>
/catalog/controller/common/footer.php

Code: Select all

<?php  

class ControllerCommonFooter extends Controller {

	protected function index() {

		$this->language->load('common/footer');

		

		$this->data['text_information'] = $this->language->get('text_information');

		$this->data['text_service'] = $this->language->get('text_service');

		$this->data['text_extra'] = $this->language->get('text_extra');

		$this->data['text_contact'] = $this->language->get('text_contact');

		$this->data['text_return'] = $this->language->get('text_return');

    	$this->data['text_sitemap'] = $this->language->get('text_sitemap');

		$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');

		$this->data['text_voucher'] = $this->language->get('text_voucher');

		$this->data['text_affiliate'] = $this->language->get('text_affiliate');

		$this->data['text_special'] = $this->language->get('text_special');

		$this->data['text_account'] = $this->language->get('text_account');

		$this->data['text_order'] = $this->language->get('text_order');

		$this->data['text_wishlist'] = $this->language->get('text_wishlist');

		$this->data['text_newsletter'] = $this->language->get('text_newsletter');

		

		$this->load->model('catalog/information');

		

		$this->data['informations'] = array();



		foreach ($this->model_catalog_information->getInformations() as $result) {

			if ($result['bottom']) {

				$this->data['informations'][] = array(

					'title' => $result['title'],

					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])

				);

			}

    	}

    	

		$this->load->model('localisation/language');



        $languages = $this->model_localisation_language->getLanguages();

        foreach ($languages as $language) {

            if ($language['code'] == $this->session->data['language']) {



                $this->data['language_id'] = $language['language_id'];

            }

        }



		$this->data['contact'] = $this->url->link('information/contact');

		$this->data['return'] = $this->url->link('account/return/insert', '', 'SSL');

    	$this->data['sitemap'] = $this->url->link('information/sitemap');

		$this->data['manufacturer'] = $this->url->link('product/manufacturer');

		$this->data['voucher'] = $this->url->link('account/voucher', '', 'SSL');

		$this->data['affiliate'] = $this->url->link('affiliate/account', '', 'SSL');

		$this->data['special'] = $this->url->link('product/special');

		$this->data['account'] = $this->url->link('account/account', '', 'SSL');

		$this->data['order'] = $this->url->link('account/order', '', 'SSL');

		$this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');

		$this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');		



		$this->data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time()));

		

		// Whos Online

		if ($this->config->get('config_customer_online')) {

			$this->load->model('tool/online');

	

			if (isset($this->request->server['REMOTE_ADDR'])) {

				$ip = $this->request->server['REMOTE_ADDR'];	

			} else {

				$ip = ''; 

			}

			

			if (isset($this->request->server['HTTP_HOST']) && isset($this->request->server['REQUEST_URI'])) {

				$url = 'http://' . $this->request->server['HTTP_HOST'] . $this->request->server['REQUEST_URI'];	

			} else {

				$url = '';

			}

			

			if (isset($this->request->server['HTTP_REFERER'])) {

				$referer = $this->request->server['HTTP_REFERER'];	

			} else {

				$referer = '';

			}

						

			$this->model_tool_online->whosonline($ip, $this->customer->getId(), $url, $referer);

		}

		

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/footer.tpl')) {

			$this->template = $this->config->get('config_template') . '/template/common/footer.tpl';

		} else {

			$this->template = 'default/template/common/footer.tpl';

		}

		

		$this->render();

	}

}

?>


Newbie

Posts

Joined
Tue Sep 05, 2017 5:02 pm

Post by rjcalifornia » Thu Nov 16, 2017 3:01 pm

You should place the link below the "<div id="footer">" tag

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by toothless3010 » Thu Nov 16, 2017 3:38 pm

Hi rjcalifornia. Thanks for replying. If you dont mind can you guide me step by step? Im still learning the environment. Im sorry.

Newbie

Posts

Joined
Tue Sep 05, 2017 5:02 pm
Who is online

Users browsing this forum: No registered users and 131 guests