Post by grimbone » Tue Feb 26, 2013 9:31 am

I am trying to customise the category.tlp and cant seem to get this code to check if the user is logged in or out. Below is the code I have added to the category.tlp

Code: Select all

<div class="box">
  <div class="box-heading"><?php echo $heading_title; ?></div>
  <div class="box-content">
    <ul class="box-category">
      <?php foreach ($categories as $category) { ?>
      <li>
        <?php if ($category['category_id'] == $category_id) { ?>
        <a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
        <?php } else { ?>
        <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
        <?php } ?>
        <?php if ($category['children']) { ?>
        <ul>
          <?php foreach ($category['children'] as $child) { ?>
          <li>
            <?php if ($child['category_id'] == $child_id) { ?>
            <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
            <?php } else { ?>
            <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
            <?php } ?>
          </li>
          <?php } ?>
        </ul>
        <?php } ?>
      </li>
      <?php } ?>
    </ul>
  </div>
</div>

<div class="box">
  <div class="box-heading">Information</div>
  <div class="box-content">
     <ul class="box-category">

      <?php if (!$logged) { ?>
	<li><a href="/login">Login</a> / <a href="/register">Register</a></li>
	<li><a href="/forgotten">Forgotten Password</a></li>
      <?php } ?>

	<li><a href="/account">My Account</a></li>
      
      <?php if ($logged) { ?>
	<li><a href="/edit">Edit Account</a></li>
	<li><a href="/password">Password</a></li>
      <?php } ?>

	<li><a href="/wishlist" title="Wish List">Wish List</a></li>

	<li><a href="/order" title="Orders">Order History</a></li>

	<li><a href="/transaction" title="Jar Candles">Transactions</a></li>

	<li><a href="/terms-conditions" title="Terms and Conditions">Terms & Conditions</a></li>

	<li><a href="/privacy-policy" title="Privacy Policy">Privacy Policy</a></li>

	<li><a href="/delivery-information" title="Shipping Information">Delivery Information</a></li>

	<li><a href="/customer-service" title="Customer Service">Customer Service</a></li>

	<li><a href="/about-us" title="About Us">About Us</a></li>

	<li><a href="/press" title="Press Release">Press Releases</a></li>

	<li><a href="/corporate" title="Corporate Accounts">Corporate Accounts</a></li>

	<li><a href="/sitemap" title="Site Map">Site Map</a></li>
      
      <?php if ($logged) { ?>
	<li><a href="/logout">Logout</a></li>
      <?php } ?>

     </ul>
  </div>
</div>
Can anyone take a peek at the code and help me out with this?
Last edited by grimbone on Sun Aug 04, 2013 3:47 am, edited 1 time in total.

New member

Posts

Joined
Tue Feb 26, 2013 9:23 am

Post by ChetanCx » Tue Feb 26, 2013 9:46 pm

use this to check

Code: Select all

<?php if (!$this->customer->isLogged()) { ?>
<li><a href="/login">Login</a> / <a href="/register">Register</a></li>
 <li><a href="/forgotten">Forgotten Password</a></li>
<?php } ?>

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by grimbone » Wed Feb 27, 2013 12:09 am

That worked perfect! Thank you very much!

New member

Posts

Joined
Tue Feb 26, 2013 9:23 am
Who is online

Users browsing this forum: No registered users and 49 guests