Post by kreativ » Fri Sep 02, 2011 5:21 am

Please forgive me if this has been addressed before, but I have not seen an explanation nor a post here in the forum addressing this issue.
I have already a site up and running in WP and I would like to be able to create the links in the OC's menu to link both the WP site and the OC..I wish to keep running both DB separate for security, file size and ease to troubleshoot.
Also I have a basic PHP coding knowledge but not enough to find out where and how to achieve this, any help would be really appreciated
Note: The WP is installed in the root directory and the OC is in it's own directory... OC version 1.5.1

Attachments

Untitled-1a.jpg

Untitled-1a.jpg (10.4 KiB) Viewed 830 times

Last edited by kreativ on Sun Sep 04, 2011 4:04 am, edited 1 time in total.

Newbie

Posts

Joined
Fri Sep 02, 2011 4:55 am

Post by kreativ » Fri Sep 02, 2011 4:58 pm

Any ideas anyone???? or at least can someone point me in the right direction :ponder:

Newbie

Posts

Joined
Fri Sep 02, 2011 4:55 am

Post by labeshops » Fri Sep 02, 2011 7:56 pm

Where in the menu do you want to add it?

If in the top menu, open your /common/header.tpl file, and look for at the bottom:

Code: Select all

<?php if ($categories) { ?>
<div id="menu">
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
</div>
<?php } ?>
<div id="notification"></div>
Add the link you want manually like this - you might need to play with the placement depending on where you want your link to appear (note: you can also manually code your top menu as I have on several of my sites by manually inserting the links and taking out the $category calls).

Code: Select all

<div id="menu">
  <ul>
<li><a href="yourbloglink">Blog Link</a>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
If you want to add it in the category menu, you can also add the link manually to module/category.tpl

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by kreativ » Sun Sep 04, 2011 4:03 am

Thanks for the help it worked a charm!!!

Newbie

Posts

Joined
Fri Sep 02, 2011 4:55 am

Post by labeshops » Sun Sep 04, 2011 9:53 pm

Anytime :)

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA
Who is online

Users browsing this forum: No registered users and 93 guests