Post by pgp » Sat Aug 29, 2015 8:46 am

Hi guys,

Hope someone can help me out here. Header search area doesn't return any results right now after upgrading to ver 1.5.6.1

For an example, I search term "hp p1005" in to the header search box. This is the url it returns back but no results showing.
http://domainname/index.php?route=produ ... hp%20p1005

If I change url to include filter_name tag then I can see the results.
http://domainname/index.php?route=produ ... filter_nam[/b]e=hp%20p1005

How do I modify my search in the header to return filter_name tag with search url? hope this make sense to you.

Thank you.

pgp
New member

Posts

Joined
Mon Jan 30, 2012 1:08 pm

Post by pgp » Wed Sep 02, 2015 5:21 am

any help guys?

pgp
New member

Posts

Joined
Mon Jan 30, 2012 1:08 pm

Post by pgp » Sun Sep 06, 2015 7:24 pm

This is my header search code. Not sure what I'm missing here though?

Code: Select all

  <div id="search"> 
    <?php if ($search) { ?>
      <input type="text" name="search" value="<?php echo $search&filter_name; ?>" />
      <?php } else { ?>
      <input type="text" name="search" value="<?php echo $search&filter_name; ?>" onclick="this.value = '';" onkeydown="this.style.color = '000000'" style="color: #999;" />
      <?php } ?>
       <div class="button-search"></div>
When I search it doesn't include &fileter_name tag to search results. So not getting any results back. Any one knows how to fix this so the return url include filter_name as well?

My current return url after searching through header search box is;

Code: Select all

http://mydomainname/index.php?route=product/search&search=hp%20p1005
If I change same url to include &filter_name as below, then I get product returned via search;

Code: Select all

http://mydomainname/index.php?route=product/search&filter_name=hp%20p1005
Thanks guys, I have no idea why its not working.

pgp
New member

Posts

Joined
Mon Jan 30, 2012 1:08 pm

Post by deepvision » Tue Sep 08, 2015 7:02 pm

There is not enough information on how $search and $filtername variables are processed in the controller but
you should probably change

Code: Select all

 <input type="text" name="search" value="<?php echo $search&filter_name; ?>" />
to

Code: Select all

 <input type="text" name="filter_name" value="<?php echo $search; ?>" />
Or maybe to

Code: Select all

 <input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
if filter_name is handled properly in the controller.

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by pgp » Wed Sep 09, 2015 5:22 am

That didn't do much help. Still won't return any results :(

I have these entries in the system --> log

2015-09-09 7:17:38 - PHP Notice: Undefined index: filter_name in /home/sydne716/public_html/vqmod/vqcache/vq2-catalog_model_catalog_product.php on line 481
2015-09-09 7:17:38 - PHP Notice: Undefined index: filter_name in /home/sydne716/public_html/vqmod/vqcache/vq2-catalog_model_catalog_product.php on line 481
2015-09-09 7:17:38 - PHP Notice: Undefined index: filter_name in /home/sydne716/public_html/vqmod/vqcache/vq2-catalog_model_catalog_product.php on line 481
2015-09-09 7:17:38 - PHP Notice: Undefined index: filter_name in /home/sydne716/public_html/vqmod/vqcache/vq2-catalog_model_catalog_product.php on line 481
2015-09-09 7:17:38 - PHP Notice: Undefined variable: filter_name in /home/sydne716/public_html/catalog/view/theme/gentle/template/common/header.tpl on line 184

and this is my search in header

Code: Select all

<div id="search"> 
    <?php if ($search) { ?>
      <input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
      <?php } else { ?>
      <input type="text" name="filter_name" value="<?php echo $filter_name; ?>" onclick="this.value = '';" onkeydown="this.style.color = '000000'" style="color: #999;" />
      <?php } ?>
       <div class="button-search"></div>

pgp
New member

Posts

Joined
Mon Jan 30, 2012 1:08 pm

Post by pgp » Sun Sep 13, 2015 7:13 pm

ok turned out it was my common.js file which was replaced with the version upgrade. Uploaded from backups and all good now. Thank you for your help.

pgp
New member

Posts

Joined
Mon Jan 30, 2012 1:08 pm

Post by vitaliyburov » Tue Feb 16, 2016 4:27 am

Hi,
I have a similar issue. I made a new simple design for the search button. When I click on the magnifying glass, the search window expands... The code needed to be changed and so the names of each function...Also, for the animation, I added a ned DIV tag. The problem here is when I hit enter to search for an item, it does nothing (doesn't bring me to the search page). However, it does give me a new address, www....com//?search= itemIlook4#

Here is the code I used:
<div id="search" class="input-group">
<form class="search-form">
<div class="form-group has-feedback">
<input class="form-control input-lg" type="text" name="search" autocomplete="off" value="<?php echo $search; ?>" placeholder="<?php echo $text_search; ?>" id="search"/>
<span class="glyphicon glyphicon-search form-control-feedback input-group-btn">
</span>
</div>
</form>
</div>

Your help will be appreciated!

Newbie

Posts

Joined
Mon Jan 25, 2016 4:25 am
Who is online

Users browsing this forum: No registered users and 31 guests