Post by bluefuze » Tue Jul 07, 2009 6:48 am

I want to move "Privacy Policy" and "Terms & Conditions" under "Contact Us" and "Site Map" -- but the way the template constructs this module makes this difficult... since "Privacy Policy" and "Terms & Conditions" are part of the admin area, and "Contact Us" and "Site Map" are hard coded.

So, anyone know how to fix this?

I've considered reconstrcting the Information module to have the list code hardcoded... but then the links wouldn't be dynamic anymore... they would be permanent. Any workarounds?

Thanks

Newbie

Posts

Joined
Sat Jul 04, 2009 12:45 am

Post by iloveopencart » Tue Jul 07, 2009 2:09 pm

I had a similar need where I wanted to put Terms & Conditions and Privacy Policy in the footer, under the copyright. Here's the basic steps I followed with a fresh install of OC 1.2.9, customized for your needs:

1) First, we want to put the information pages into a more logical order. Go into admin and change the sort orders of the information pages. Set Terms to 1, Privacy to 2, and About Us to 3.

2) Then, using phpMyAdmin (sorry, no lesson on how use phpMyAdmin here :P), select the information table and change the information_id fields to match the sort orders. I also then went to the operations tab and changed the AUTO_INCREMENT to 4.

3) Next, select the information_description table and change the information_id fields to match - Terms to 1, Privacy to 2, and About Us to 3.

4) Now log back into your admin, go to Settings, and reselect your Account Terms and Checkout Terms in the Options tab.

5) Open catalog/view/theme/default/template/module/information.tpl and replace the following code:

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


with:

Code: Select all

<ul>
      <?php foreach ($informations as $information) { ?>
        <!-- Display all information pages except Terms and Privacy -->
        <?php if($information['id'] > 2) { ?>
          <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
        <?php } ?>
      <?php } ?>
      <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
      <li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>
      <?php foreach ($informations as $information) { ?>
        <!-- Display ONLY Terms and Privacy -->
        <?php if($information['id'] < 3) { ?>
          <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
        <?php } ?>
      <?php } ?>
</ul>
6) Now open catalog/controller/module/information.php and add the following code BEFORE line 17
'title' => $result['title'],:

Code: Select all

'id'    => $result['information_id'],
There you have it. Here's what it looks like:

Image

You can do the same with the sitemap, too.

User avatar
Global Moderator

Posts

Joined
Thu Mar 05, 2009 11:15 pm
Location - Phoenix, AZ

Post by iloveopencart » Tue Jul 07, 2009 2:29 pm

By the way, to keep Terms and Privacy from getting deleted accidentally by admin, open admin/view/template/catalog/information_list.tpl and replace lines 35 to 39 with:

Code: Select all

        <td style="align: center;"><?php if($information['information_id'] > 2) { ?><?php if ($information['delete']) { ?>
          <input type="checkbox" name="delete[]" value="<?php echo $information['information_id']; ?>" checked="checked" />
          <?php } else { ?>
          <input type="checkbox" name="delete[]" value="<?php echo $information['information_id']; ?>" />
          <?php } ?><?php } ?></td>
This will remove the DELETE box for Terms and Privacy after the steps in the previous post have been completed:

Image

User avatar
Global Moderator

Posts

Joined
Thu Mar 05, 2009 11:15 pm
Location - Phoenix, AZ

Post by bluefuze » Tue Jul 07, 2009 11:42 pm

Wow, thanks for taking the time to post that. I'll give it a shot. Thanks again!

Newbie

Posts

Joined
Sat Jul 04, 2009 12:45 am
Who is online

Users browsing this forum: No registered users and 11 guests