Quote:
Originally Posted by intel352
4.1 already has the functionality, was looking at the code this morning, it crafts a "GET" url when search results are accessed. my assumption is it then redirects to that url or maybe provides a link in the content saying "link to these search results"
[/code]
|
I added the following with the BCSE free mod and that from 4.1:
BCSE mod:
http://forum.x-cart.com/showthread.php?t=18488
search.php
Code:
x_session_register("search_data");
# BCSE begin
if($search)
{
$search_data['products']['substring']=$search;
$mode="search";
}
# BCSE end
if (!empty($search_data["products"])) {
# only show fields we really care about
$allowable_search_fields = array( "substring", "sort_field", "sort_direction" );
$search_url_args = array();
# from 4.1
foreach ($search_data["products"] as $k=>$v) {
if (in_array($k, $allowable_search_fields) && !empty($v)) {
if (is_array($v)) {
foreach ($v as $k1=>$v1)
$search_url_args[] = $k."[".$k1."]=".urlencode($v1);
}
else {
$search_url_args[] = "$k=".urlencode($v);
}
}
}
# show page if needed
if ($search_url_args && $page > 1)
$search_url_args[] = "page=$page";
$search_url = "search.php?mode=search".(!empty($search_url_args) ? "&".implode("&", $search_url_args) : "");
$smarty->assign("search_url", $search_url);
}
customer/main/search_results.tpl
paste this where you want the link to display:
Code:
<DIV align="right"><A href={$search_url}>This page URL</A></DIV>