Post by leelnj » Fri Dec 07, 2012 6:01 pm

Hello all.

Im just wondering if there is a simple way of displaying the search bar and cart in the category pages but not in the home page. I have taken out the div and echo related to displaying these 2 things from the common/ header. tpl but this removes it from all the home and category pages.....any ideas. I got given this piece of code

$current_route = empty($request->get['route']) ? 'common/home' : $request->get['route'];
if ($current_route = 'product/category') {
... search bar code ...
}

to put in the header.tpl file which i presume is saying exclude searchbar code from homepage and include it in category pages. What i dont get is if this code is correct how it should be written as that is not valid code in my text editor and where it should be put in my header.tpl file.Or is there a different way of doing this. Many thanks CURRENT CODE BELOW

</head>
<body>
<div id="container">
<div id="header">
<?php if ($logo) { ?>
<div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
<?php } ?>

COMMENTED OUT AT THE MOMENT
<!--<?php echo $language; ?>
<?php echo $currency; ?>!-->
<!--<?php echo $cart; ?>
<div id="search">
<div class="button-search"></div>
<?php if ($filter_name) { ?>
<input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
<?php } else { ?>
<input type="text" name="filter_name" value="<?php echo $text_search; ?>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
<?php } ?>
</div>!-->
<!--<div id="welcome">
<?php if (!$logged) { ?>
<?php echo $text_welcome; ?>
<?php } else { ?>
<?php echo $text_logged; ?>
<?php } ?>
</div>!-->
<!--<div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>!--> COMMENTED OUT AT THE MOMENT
</div>
<?php if ($categories) { ?>
<div id="menu">
<ul>
<li><A href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
<?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>

New member

Posts

Joined
Wed Dec 05, 2012 2:26 am
Who is online

Users browsing this forum: No registered users and 16 guests