Community Forums

(solved) Add new page/link to "customer service" in footer

Template support & advice for OpenCart v1.x

(solved) Add new page/link to "customer service" in footer

Postby Vectra » Fri Jun 01, 2012 5:05 pm

fresh v1.5.2.1 In OpenCart Admin/catalog/information, I can easily insert new pages under the "information" footer. How can I do this for "customer service" in footer? Should I create the page in admin under "information" and then somehow move it to customer service?
The footer.tpl file at theme/template doesn't refer to each page individually for "information" as it seems to for "service". See below:
Code: Select all
<div id="footer">
  <div class="column">
    <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>
  <div class="column">
    <h3><?php echo $text_service; ?></h3>
    <ul>
      <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>

How do I add new pages (like warranty or manuals) under "customer service" in the footer?
Thank you.
Last edited by Vectra on Sat Jun 02, 2012 6:11 pm, edited 1 time in total.
Vectra
 
Posts: 55
Joined: Fri May 11, 2012 2:32 pm

Re: Add new page/link to "customer service" in footer

Postby sans » Fri Jun 01, 2012 9:49 pm

You must create some file for new page, in folder controller, language and view. After that you must change file footer to put link.
sans
 
Posts: 419
Joined: Mon Dec 06, 2010 8:18 pm

Re: Add new page/link to "customer service" in footer

Postby Vectra » Sat Jun 02, 2012 1:15 am

Thank you for the reply. I will look into those files. I am not sure that I will get it figured out, but I will try.
As I understand what you said, I establish the existance and location of the new file by following your directions. How would I modify/edit and add content to the file itself? Would I see it in Admin somewhere?
Thank you.
Vectra
 
Posts: 55
Joined: Fri May 11, 2012 2:32 pm

Re: Add new page/link to "customer service" in footer

Postby mcamca » Sat Jun 02, 2012 6:12 am

How do I add new pages (like warranty or manuals) under "customer service" in the footer?
Thank you.

This was easy to achieve in some earlier 1.4 versions of OC but was left out of v1.5.2.1 for some reason! Maybe it interferes with other functions but I have not yet found this to be true!
To achieve this in v1.5.2.1 in:
/catalog/model/catalog/information.php
Change:
Code: Select all
   public function getInformations() {
      $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' ORDER BY i.sort_order, LCASE(id.title) ASC");
      
      return $query->rows;
   }

To:
Code: Select all
   public function getInformations() {
      $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' AND i.sort_order <> '-1' ORDER BY i.sort_order, LCASE(id.title) ASC");
      
      return $query->rows;
   }

Create a new information page in admin containing the data you want and give it a sort order of 1
Enable the page and "Save".
The new page will now appear in the information section of the footer.
Go to the page and copy the address which shows in your browser.
Go back into admin and give this page a sort order of -1 and "Save".
You'll now find that the page with a sort order of -1 does not show in the information section.
Repeat the above for any additional pages.
You can now hardcode the above page addresses where you like under "Extras", "Customer Service" etc. in footer.tpl
eg. for Customer services enter:
Code: Select all
  <div class="column">
    <h3><?php echo $text_service; ?></h3>
    <ul>
      <li><a href="index.php?route=information/information&information_id=20">Warranty</a></li>
      <li><a href="index.php?route=information/information&information_id=21">Manuals</a></li>
      <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>

Where the address for the 2 pages is determined as above (NOT THE ABOVE EXAMPLES OF 20 and 21).
BACKUP ANY FILES BEFORE CHANGING!
Last edited by mcamca on Sat Jun 02, 2012 6:37 am, edited 1 time in total.
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 4:57 am

Re: Add new page/link to "customer service" in footer

Postby mcamca » Sat Jun 02, 2012 6:30 am

If the manuals you are referring to are in pdf format, they can be uploaded to the server anywhere that you like and opened in a new window using code similar to the following:
Code: Select all
  <div class="column">
    <h3><?php echo $text_service; ?></h3>
    <ul>
      <li><a href="index.php?route=information/information&information_id=20">Warranty</a></li>
      <li><a href="catalog/view/theme/yourtheme/pdfs/manuals.pdf" target="_manuals">Manuals</a></li>
      <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>

"catalog/view/theme/yourtheme/pdfs/manuals.pdf" is just an example of the location of your pdf file.
HOPE THIS HELPS!
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 4:57 am

Re: (solved) Add new page/link to "customer service" in foot

Postby Vectra » Sat Jun 02, 2012 6:32 pm

Excellent helpful reply! Thank you very much. I will do this on Monday.
I guess I have to ask this: what is the code for a select drop down box to have these pdf manuals in? Just listing the manuals is fine, but a drop down is cleaner.
Thank you very much.
Vectra
 
Posts: 55
Joined: Fri May 11, 2012 2:32 pm

Re: (solved) Add new page/link to "customer service" in foot

Postby mcamca » Sun Jun 03, 2012 9:27 am

Try this:
Code: Select all
  <div class="column">
    <h3><?php echo $text_service; ?></h3>
    <ul>
      <li><a href="index.php?route=information/information&information_id=20">Warranty</a></li>
      <li>Manuals:<br />
      <select name="manuals" onchange="ob=manuals;window.open(ob.options[ob.selectedIndex].value)">
      <option value="">Select....</option>
      <option value="http://www.yahoo.com/">YAHOO</option>
      <option value="http://www.google.com/">GOOGLE</option>
      <option value="http://www.altavista.com/">ALTAVISTA</option>
      <option value="http://www.amazon.com/">AMAZON</option></select></li>
      <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>

Change" YAHOO" to the manual name and "http://www.yahoo.com/" to the address on your server for that manual.
Do the same for the rest, delete or add options as you want!
Have'nt checked in v1.5.2.1 but should work!
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 4:57 am

Re: (solved) Add new page/link to "customer service" in foot

Postby Vectra » Mon Jun 04, 2012 4:47 pm

Thank you again.
Moving the information page over was easy (because of your instructions). As I suspected, it did break the SEO Keyword ability if the keyword is added after setting up the link. I will update the footer.tpl href= address for after the SEO keyword has taken effect.
I tried your nice select dropdown code. I put the below in the text body on the information page. It showed up nicely and worked in IE8 after I clicked to "allow popups". In Chrome, I didn't see anything happen at all.

Code: Select all
      <li>Manuals:<br />
      <select name="manuals" onchange="ob=manuals;window.open(ob.options[ob.selectedIndex].value)">
      <option value="">Select....</option>
      <option value="http://www.yahoo.com/">YAHOO</option>
      <option value="http://www.google.com/">GOOGLE</option>
      <option value="http://www.altavista.com/">ALTAVISTA</option>
      <option value="http://www.amazon.com/">AMAZON</option></select></li>

I think I will just make a page in "information" and highlight and insert hyperlinks. The one problem I am having is something is overriding the font size when I add the link. The link text becomes smaller, underlined and hot, but ignores my attempts to change its font size. I want these links larger not smaller.
Thank you again.
Vectra
 
Posts: 55
Joined: Fri May 11, 2012 2:32 pm

Re: (solved) Add new page/link to "customer service" in foot

Postby mcamca » Tue Jun 05, 2012 8:57 am

The select box probably did'nt work in chrome because there was no form field.
Try:
Code: Select all
  <div class="column">
    <h3><?php echo $text_service; ?></h3>
    <ul>
      <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>
      <li><a href="index.php?route=information/information&information_id=20">Warranty</a></li>
      <li><form action="../">Manuals:<br />
      <select name="manuals" onchange="ob=this.form.manuals;window.open(ob.options[ob.selectedIndex].value)">
      <option value="">Select....</option>
      <option value="http://www.yahoo.com/">YAHOO</option>
      <option value="http://www.google.com/">GOOGLE</option>
      <option value="http://www.altavista.com/">ALTAVISTA</option>
      <option value="http://www.amazon.com/">AMAZON</option></select></form></li>
    </ul>
  </div>

If this does'nt work in Chrome then you probably need a separate javascript function which is used as the onChange event for the select box!
(The manuals have been moved to the bottom of the list because a form closure produces an ugly gap!)

If you want to override the default css settings for a link on an Information page, use the following:
Code: Select all
<a href="http://www.google.com" style="text-decoration: none" target="_manuals"><span style="color: #000000; font-size: 14px">Manual Name</span></a>

Change font-size, link, Manual Name and color to those that you want!
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 4:57 am

Re: (solved) Add new page/link to "customer service" in foot

Postby Vectra » Tue Jun 05, 2012 4:26 pm

Thank you again. I put <span style=" font-size: 18px"> in every instance of linked text on a couple of my pages done in "information". It worked well.
Your latest drop down select box worked great in GC and FF. In IE8 and IE9 I had to allow pop-ups and then select a 2nd time, but it looked and worked great.
Thank you.
Vectra
 
Posts: 55
Joined: Fri May 11, 2012 2:32 pm

Re: (solved) Add new page/link to "customer service" in foot

Postby mcamca » Tue Jun 05, 2012 5:40 pm

Glad it worked and nice to get thanked!
Most do not bother to thank or say anything!
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 4:57 am

Re: (solved) Add new page/link to "customer service" in foot

Postby Vectra » Tue Jun 05, 2012 6:33 pm

I have heard that Super Heroes have the same problem... People are so happy to get their cats back out of the tree that they don't notice you flying off to another rescue.
Vectra
 
Posts: 55
Joined: Fri May 11, 2012 2:32 pm


Return to Template Support

Who is online

Users browsing this forum: Bing [Bot] and 25 guests

Hosted by Arvixe Web Hosting