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. Thanks in advance
Hope this helps.
Code: Select all
$current_route = empty($request->get['route']) ? 'common/home' : $request->get['route'];
if ($current_route = 'product/category') {
... search bar code ...
}
Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite
irc.freenode.net #opencart
sorry mate. im a novice at php. where exactly am i putting that code. my header file looks like this. And do i need to add anything with that code eg <php? as when i enter it in the file its not valid code. Thanks in advance
</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>
</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>
Hello All
Thanks in advance
I am trying to create a subscribe form in my footer. MY CODE WHICH I ENTERED IN THE FOOTER.TPL FILE IS BELOW.
<div class="column">
<form action="http://[your store url]/phpForm.php" method="post" enctype="multipart/form-data" name="contactForm" id="contactform">
<h3>Subscribe</h3>
<label>Subscribe for the latest updates and offers</label><br /><br />
<input type="text" name="contactFirstName" /><br /><br />
<input type="text" name="contactEmail" /><br /><br />
<input type="button" value="SEND" id="submit1" />
</form>
</div>
i have then created a seperate php form posted below. The problem is the button is not clicking at all. its acting like an image with no button mechanism…Any ideas. Thanks
<?php
if($_POST["contactFirstName"]){
$contactFirstName = stripslashes($_POST["contactFirstName"]);
$contactEmail = stripslashes($_POST["contactEmail"]);
$to = "[PUT YOUR ADMIN EMAIL ADDRESS HERE]";
$subject = "Contact form Submitted";
$theEmail = "$contactFirstName $contactLastName ($contactEmail) sent a message through your form! Their message was: $contactMessage";
$headers = "Content-type: text/html\r\n";
$headers .= "From: admin@youropencartstore.com\r\n";
mail($to, $subject, $theEmail, $headers);
$to2 = "$leadEmail";
$subject2 = "Thanks, we have your message!";
$theEmail2 = "
<h1>Thanks for subscribing!</h1>
";
$headers2 = "Content-type: text/html\r\n";
$headers2 .= "From: mail@youropencartstore.com\r\n";
mail($to2, $subject2, $theEmail2, $headers2);
header("location: http://www.youropencartstore.com/thanks");
}
?>
Thanks in advance
I am trying to create a subscribe form in my footer. MY CODE WHICH I ENTERED IN THE FOOTER.TPL FILE IS BELOW.
<div class="column">
<form action="http://[your store url]/phpForm.php" method="post" enctype="multipart/form-data" name="contactForm" id="contactform">
<h3>Subscribe</h3>
<label>Subscribe for the latest updates and offers</label><br /><br />
<input type="text" name="contactFirstName" /><br /><br />
<input type="text" name="contactEmail" /><br /><br />
<input type="button" value="SEND" id="submit1" />
</form>
</div>
i have then created a seperate php form posted below. The problem is the button is not clicking at all. its acting like an image with no button mechanism…Any ideas. Thanks
<?php
if($_POST["contactFirstName"]){
$contactFirstName = stripslashes($_POST["contactFirstName"]);
$contactEmail = stripslashes($_POST["contactEmail"]);
$to = "[PUT YOUR ADMIN EMAIL ADDRESS HERE]";
$subject = "Contact form Submitted";
$theEmail = "$contactFirstName $contactLastName ($contactEmail) sent a message through your form! Their message was: $contactMessage";
$headers = "Content-type: text/html\r\n";
$headers .= "From: admin@youropencartstore.com\r\n";
mail($to, $subject, $theEmail, $headers);
$to2 = "$leadEmail";
$subject2 = "Thanks, we have your message!";
$theEmail2 = "
<h1>Thanks for subscribing!</h1>
";
$headers2 = "Content-type: text/html\r\n";
$headers2 .= "From: mail@youropencartstore.com\r\n";
mail($to2, $subject2, $theEmail2, $headers2);
header("location: http://www.youropencartstore.com/thanks");
}
?>
Who is online
Users browsing this forum: No registered users and 16 guests