Thread: Instant Search

Page 8 of 23 FirstFirst ... 67891018 ... LastLast
Results 71 to 80 of 222
  1. #71
    Join Date
    Feb 2012
    Location
    Croatia
    Posts
    1
    Plugin Contributions
    0

    Default Re: Instant Search

    Quote Originally Posted by AyoobG View Post
    Hi, the json_encode() function is a php function which sends data from php format into javascript format.

    If some of the products contain foreign characters like č then json_encode won't work properly, and the product containing the character will stop instant search from functioning properly, hence the error.

    However if you open searches.php and replace:

    echo json_encode($results);

    with:

    Code:
    echo json_encode(utf8json($results));
    
    function utf8json($inArray) {
    
        static $depth = 0;
    
        /* our return object */
        $newArray = array();
    
        /* safety recursion limit */
        $depth ++;
        if($depth >= '30') {
            return false;
        }
    
        /* step through inArray */
        foreach($inArray as $key=>$val) {
            if(is_array($val)) {
                /* recurse on array elements */
                $newArray[$key] = utf8json($val);
            } else {
                /* encode string values */
                $newArray[$key] = utf8_encode($val);
            }
        }
    
        /* return utf8 encoded array */
        return $newArray;
    }

    then it will be able to convert these foreign characters properly.
    I have similar problem. I am using utf-8_general_ci in zencart database, Instant search works fine for me, but when i enter special character like (č枚đ) if wont display anything.
    Here is a two picture below. Please help!
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	search.jpg 
Views:	80 
Size:	27.2 KB 
ID:	10315   Click image for larger version. 

Name:	search1.jpg 
Views:	107 
Size:	24.2 KB 
ID:	10316  

  2. #72
    Join Date
    Feb 2010
    Posts
    35
    Plugin Contributions
    0

    Default Re: Instant Search

    Hi

    It's very good contrib!

    It's working perfect to me on 1.39h, but there is 1 point to update!

    I discovered that if you have multiple products with the same keywords but in a different order, only the results with the words in the same order as the research emerge. I need all the products with the same keywords in any order can emerge!

    thanks for you help!

  3. #73
    Join Date
    May 2012
    Location
    Venezuela
    Posts
    5
    Plugin Contributions
    0

    Have a Drink Re: Instant Search

    Quote Originally Posted by AyoobG View Post
    I think the problem lies in the order of each .js file being called in your web page.

    for example instantSearch.js depends on jquery.js, so if we want both of these files to work we need to call jquery.js first and then instantSearch.js, i.e:

    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="instantSearch.js"></script>

    however if we do it the other way round it will not work i.e call instantSearch.js first and then jquery.js:

    <script type="text/javascript" src="instantSearch.js"></script>
    <script type="text/javascript" src="jquery.js"></script>

    My theory is that the image swapper is compatible with the old jquery file and will not work with the new one that comes with instantsearch, i.e when we install instant search with your image swapper this is how it looks:

    <script type="text/javascript" src="jquery.js"></script> <--new
    <script type="text/javascript" src="instantSearch.js"></script>
    <script type="text/javascript" src="jquery.js"></script> <--old
    <script type="text/javascript" src="imageSwaper.js"></script>

    from the above you can see that instant search will work since it calls the new jquery file and image swapper will not work since it is also stuck with the new jquery file (it will ignore the old jquery file).

    I think this might be your problem, but i'm not sure, it would be better if i could of had access to your sites header code.

    what you can try is to remove both the references to jquery.js and instantSearch.js that came with instant search. Then go into the image swapper part of the code and add the instantSearch.js reference there, i.e:

    <script type="text/javascript" src="jquery.js"></script> <--old
    <script type="text/javascript" src="imageSwaper.js"></script>
    <script type="text/javascript" src="instantSearch.js"></script>

    again i would like to say this may be one possibility, not 100% sure!

    Esto me ayudo a solventar el problema. Efectivamente, si no se muestra correctamente el slider de tu tienda zencart, entonces esta es la solución que debes aplicar, incluyendo el .js correspondiente al slider en el archivo jscript_instantSearch.php ubicado en la contribución Instant Search.

    Al creador de esta contribución, lo saludo y agradezco por ella, es muy útil y causa una mejor experiencia al cliente cuando visita tu tienda zencart.

    Saludos a todo y perdón por el idioma.

  4. #74
    Join Date
    Dec 2011
    Posts
    19
    Plugin Contributions
    0

    Default Re: Instant Search

    Now that would be a very nice and logical modification. Does anyone know how to do this?



    Quote Originally Posted by triumph View Post
    Hi

    It's very good contrib!

    It's working perfect to me on 1.39h, but there is 1 point to update!

    I discovered that if you have multiple products with the same keywords but in a different order, only the results with the words in the same order as the research emerge. I need all the products with the same keywords in any order can emerge!

    thanks for you help!

  5. #75
    Join Date
    Jun 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Instant Search

    The addon does not generate full cPath for categories, for example.. if the product is in subcategory
    index.php?main_page=index&cPath=35_37_43

    search script only generates
    index.php?main_page=index&cPath=43

    How can I make the script to generate full cpath?

  6. #76
    Join Date
    Jun 2009
    Posts
    19
    Plugin Contributions
    0

    Default Re: Instant Search

    Quote Originally Posted by Loter View Post
    The addon does not generate full cPath for categories, for example.. if the product is in subcategory
    index.php?main_page=index&cPath=35_37_43

    search script only generates
    index.php?main_page=index&cPath=43

    How can I make the script to generate full cpath?

    I've added a function in searches.php that generates full cpaths

    function getcPath($catid)
    {
    global $db;
    $retstr=0;
    if($catid!=0)
    {
    $sqlcPath = "SELECT parent_id from ".TABLE_CATEGORIES." where categories_id=".mysql_real_escape_string($catid);
    //echo "<br>".$sqlcPath."<br>";
    $dbcPath = $db->Execute($sqlcPath);
    if ($dbcPath->RecordCount() > 0) {
    $retstr = $dbcPath->fields['parent_id'];
    }
    }else
    {
    $retstr = 0;
    }
    return $retstr;
    }
    function calccPath($catid)
    {
    $sep = "_";
    $retstr = $catid;
    do
    {
    $currpath = getcPath($catid);
    $catid=$currpath;
    if($catid!=0)
    {
    $retstr = $catid.$sep.$retstr;
    }
    }while($currpath!=0);
    return $retstr;
    }

    then below:
    $prodResult = strip_tags($dbCategories->fields['categories_name']);

    added:
    $dbCategories->fields['categories_id'] = calccPath($dbCategories->fields['categories_id']);

  7. #77
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: Instant Search

    I only want to use this mod on a particular new page to conduct a search of a particular new DB table.

    From the readme.htm, I am wondering if it would be better to change the following file placements from

    searches.php
    includes/templates/MYTEMPLATE/css/instantSearch.css
    includes/templates/MYTEMPLATE/jscript/instantSearch.js
    includes/templates/MYTEMPLATE/jscript/jquery.js
    includes/templates/MYTEMPLATE/jscript/jscript_instantSearch.php

    to

    searches.php
    includes/templates/MYTEMPLATE/css/instantSearch.css
    includes/modules/mypage/instantSearch.js
    includes/templates/MYTEMPLATE/jscript/jquery.js
    includes/modules/mypage/jscript_instantSearch.php


    OR

    to follow the original readme instructions and just add the highlighted line to instantSearch.js after Line 36

    //var inputBox = $('#navMainSearch > form[name="quick_find_header"] > input[name="keyword"]');
    //var inputBox = $('#navColumnTwoWrapper > form[name="quick_find_header"] > input[name="keyword"]');
    //var inputBox = $('#searchContent > form[name="quick_find"] > input[name="keyword"]');
    var inputBox = $('#mypage > form[name="mysearch"] > input[name="keyword"]');


    Thanks

  8. #78
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: Instant Search

    Line 145 of searches.php has

    Code:
    foreach ($resultsAddAfter as &$value) {
    Could someone please confirm whether the ampersand & is a typo or whatever, and that line should read

    Code:
    foreach ($resultsAddAfter as $value) {
    thanks in advance

  9. #79
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: Instant Search

    Further to above, the offending code can be seen in this post.

    http://www.zen-cart.com/showthread.p...31#post1107931

    Ctrl_F &$

  10. #80
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: Instant Search

    Solved. &$var refers to the variable reference rather than a variable value.

 

 
Page 8 of 23 FirstFirst ... 67891018 ... LastLast

Similar Threads

  1. Instant Quote
    By Congerman in forum General Questions
    Replies: 2
    Last Post: 15 Aug 2012, 12:29 PM
  2. Instant Coupon
    By Mickmo68 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 22 Dec 2008, 08:19 PM
  3. Instant Delivery?
    By eaglewu in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 30 Jul 2007, 09:30 AM
  4. changes instant
    By chufty bill in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Sep 2006, 07:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR