First off, I wanted to thank everyone for the help and advice. I would still be lost if it wasn’t for the awesome Modx community!
My issue has been solved and I am now able to stack the products results on top of the news results. The correct code is below, the biggest issue was with the prefix for the facet results. It is best to check the SimpleSearch snippet around line 50-70 for a variable named: $placeholderPrefix. That will tell your the correct prefix to use.
SOLUTION TO STACKING RESULTS
Calls from the search page
[[!SimpleSearch?
&containerTpl=`tplSearchResults`
&tpl=`tplSearchResultItem`
&toPlaceholder=`sisea.results`
&includeTVs=`1`
&andTerms=`0`
&useAllWords=`0`
&searchStyle=`partial`
&perPage=`5`
&minChars=`1`
&postHooks=`ProductNewsFacet`
]]
<h2>Search Results</h2>
[[!+simplesearch.productsnew.results]]
[[!If?
&subject=`[[!+simplesearch.productsnew.total]]`
&operator=`EQ`
&operand=``
&then=`No Results Found`
&else=``
]]
Here is the Facet "ProductNewsFacet"
There is probably a way to greatly streamline this code, but hey, it works so happy!
Bonus: I was able to use an inner join to grab a needed template variable.
$searchArraySp = explode(" ", $search);
$searchArrayHy = explode("-", $search);
$count = 0;
$cProd = $modx->newQuery('modResource');
$cNews = $modx->newQuery('modResource');
$cProd->innerJoin('modTemplateVarResource','TemplateVarResources');
$cProd->innerJoin('modTemplateVar','TemplateVar','`TemplateVar`.`id` = `TemplateVarResources`.`tmplvarid` AND `TemplateVar`.`name` = "ProductImgThumb"');
$cProd->where(array(
array(
':modResource.menutitle:LIKE' => $searchArrayHy[0] . ' %',
'OR:modResource.menutitle:LIKE' => $searchArrayHy[0] . '-%',
'OR:modResource.menutitle:LIKE' => $searchArraySp[0] . ' %',
'OR:modResource.menutitle:LIKE' => $searchArraySp[0] . '-%',
'OR:modResource.menutitle:LIKE' => $search . '-%'
),
array(
'AND:modResource.template:IN' => ['3']
),
));
$cProd->select(array(
'modResource.*',
'TemplateVar.name',
'TemplateVarResources.value',
));
$cNews->where(array(
array(
'modResource.content:LIKE' => '%' . $search . '%',
'OR:modResource.menutitle:LIKE' => '%' . $search . '%'
),
array(
'AND:modResource.template:IN' => ['6']
),
));
$cNews->select(array(
'modResource.*',
));
$cProd->limit($limit,$offset);
$cNews->limit($limit,$offset);
$products = $modx->getCollection('modResource',$cProd);
$Prodresults = array();
foreach ($products as $product) {
$id = $product->get('id');
$Prodresults[] = array(
'id' => $product->get('id'),
'pagetitle' => $product->get('pagetitle'),
'menutitle' => $product->get('menutitle'),
'ProductImgThumb' => $product->get('value'),
'link' => $modx->makeUrl($id),
'extract' => $product->get('description'),
);
$count++;
}
$news = $modx->getCollection('modResource',$cNews);
$Newsresults = array();
foreach ($news as $post) {
$postid = $post->get('id');
$Newsresults[] = array(
'id' => $post->get('id'),
'pagetitle' => $post->get('pagetitle'),
'menutitle' => $post->get('menutitle'),
'link' => $modx->makeUrl($postid),
'extract' => $post->get('description'),
);
$count++;
}
$results = array();
$results = array_merge($Prodresults, $Newsresults);
$hook->addFacet('productsnew',$results,$count);
return true;