Hello
Rather quick question - in regards to the package
CatalogSearch 1.0.
It seems to be common knowledge that the original dev. for this package isn't contactable, so I'm trying to customize this myself (with my very basic knowledge).
I want to edit the CatalogSearch snippet - this controls what TV's are shown as filters for a search.
For example, this is how the form currently looks:
It has pulled back all the TV's that are of the "List Box (Single Select)" type - using the following code:
foreach($tvids as $tvid){
$q = $modx->newQuery("modTemplateVar");
$q->where(array("id"=>$tvid->get("tmplvarid")));
$tvs = $modx->getCollection("modTemplateVar",$q);
foreach($tvs as $tv) {
if($tv->get("type") == "listbox")
$TVars[] = array(
"name" => $tv->get("name"),
"caption" => $tv->get("caption"),
"type" => $tv->get("type"),
"id" => $tv->get("id")
);
}
}
I have some TV's which are of the "
List Box (Multi Select)" format, which I would like the snippet to pull back, and display as a filter.
I think the code needs to be edited to look like this:
foreach($tvids as $tvid){
$q = $modx->newQuery("modTemplateVar");
$q->where(array("id"=>$tvid->get("tmplvarid")));
$tvs = $modx->getCollection("modTemplateVar",$q);
foreach($tvs as $tv) {
if($tv->get("type") == "listbox" || $tv->get("type") == "??NEED_TO_KNOW_TYPE_NAME??")
$TVars[] = array(
"name" => $tv->get("name"),
"caption" => $tv->get("caption"),
"type" => $tv->get("type"),
"id" => $tv->get("id")
);
}
}
As you can see I don't know what the variable name / identifier is for the
List Box (Multi Select) TV type.
Does anyone else know?
It would be greatly appreciated.
Thanks
Dan