Post by Jade » Sun Feb 14, 2010 8:43 pm

Hey every1 First time user and a bit of a noob, Im trying out OC localy atm and hac come across some modules that were built for older versions, 1 of them was the side search box mod, nothing much wrong with it but it needed some adjusting :)

Let me know how i went?
Search Box Module 1.4.0

Visit
http://www.jadenagy.com.au/


User avatar
Newbie

Posts

Joined
Sat Feb 13, 2010 9:35 am
Location - Australia

Post by Miguelito » Mon Feb 15, 2010 6:34 pm

Have to check this out though I don't who would use this... except those ones who have disabled the out-of-the-box search in the header :)

The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm

Post by Miguelito » Mon Feb 15, 2010 10:10 pm

Just verified this and the catalog template file didn't work for me.

So the actual search.tpl looks like this:

Code: Select all

<div class="box">
  <div class="top"><img src="catalog/view/theme/defult/image/icon_search.png" alt="" /><?php echo $heading_title; ?></div>
  <div id="module_search2" class="middle">
      <?php if ($keyword) { ?>
      <input type="text" name="keyword" value="<?php echo $keyword; ?>" id="filter_keyword2" />
      <?php } else { ?>
      <input type="text" name="keyword" value="<?php echo $text_keywords; ?>" id="filter_keyword2" onclick="this.value = '';" onkeydown="this.style.color = '000000'" style="color: #999;" />
      <?php } ?>
      <br/>
      <a onclick="moduleSearch2();" class="button"><span><?php echo $button_search; ?></span></a>
  </div>
<script type="text/javascript"><!--
	$('#module_search2 input').keydown(function(e) {
		if (e.keyCode == 13) {
			moduleSearch2();
		}
	});

	function moduleSearch2() {
		location = 'index.php?route=product/search&keyword=' + encodeURIComponent($('#filter_keyword2').attr('value'));
	}
	//--></script>
<div class="bottom">&nbsp;</div>
</div>
Could you also verify that this is correct or proof me being wrong, thanks :)

The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm

Post by Jade » Tue Feb 16, 2010 8:11 am

Hey mate Im not sure what didnt work for you exactly but maybe try this?

Code: Select all

<div class="box">
  <div class="top"><img src="catalog/view/theme/defult/image/icon_search.png" alt="" /><?php echo $heading_title; ?></div>
  <div id="module_search2" class="middle">
    <?php if ($keyword) { ?>
    <input type="text" name="keyword" value="<?php echo $keyword; ?>" id="filter_keyword2" />
    <?php } else { ?>
    <input type="text" name="keyword" value="<?php echo $text_keywords; ?>" id="filter_keyword2" onclick="this.value = '';" onkeydown="this.style.color = '000000'" style="color: #999;" />
    <?php } ?>
    <br/>
    <a onclick="moduleSearch2();" class="button"><span><?php echo $button_search; ?></span></a> </div>
  <div class="bottom">&nbsp;</div>
</div>
<script type="text/javascript"><!--
   $('#module_search2 input').keydown(function(e) {
      if (e.keyCode == 13) {
         moduleSearch2();
      }
   });

   function moduleSearch2() {
      location = 'index.php?route=product/search&keyword=' + encodeURIComponent($('#filter_keyword2').attr('value'));
   }
   //--></script>
If that dont work can you let me know what exactly didnt work for you and I will try to fix :)
oh and what version of OC are you running?

Visit
http://www.jadenagy.com.au/


User avatar
Newbie

Posts

Joined
Sat Feb 13, 2010 9:35 am
Location - Australia

Post by Miguelito » Tue Feb 16, 2010 4:40 pm

Product section wen to the bottom of the page - that was the problem.

The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm
Who is online

Users browsing this forum: No registered users and 2 guests