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']);
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
Line 145 of searches.php has
Could someone please confirm whether the ampersand & is a typo or whatever, and that line should readCode:foreach ($resultsAddAfter as &$value) {
thanks in advanceCode:foreach ($resultsAddAfter as $value) {
Further to above, the offending code can be seen in this post.
http://www.zen-cart.com/showthread.p...31#post1107931
Ctrl_F &$
Solved. &$var refers to the variable reference rather than a variable value.