Hi all,
to add SEO URL for Quick Search, modify 2 files :
- open addons/quick_search/js/func.js and replace function fn_change_search_value by this
function fn_change_search_value(elm, force_open, object_type, object_id, url_id)
{
$('.cm-quick-search').val($(elm).attr('text').replace(/(^\s+)|(\s+$)/g, ''));
if (force_open) {
if (object_type == 'product') {
jQuery.redirect(url_id);
} else if (object_type == 'page') {
jQuery.redirect(url_id);
} else if (object_type == 'news') {
jQuery.redirect(url_id);
}
}
}
- open /customer/addons/quick_search/views/quick_search/components/quick_search.tpl and replace
{if $patterns} ... {else}
by
{if $patterns}
{foreach from=$patterns item="pattern"}
{capture name=url_type}
{if $pattern.type == "product"}{"products.view?product_id=`$pattern.id`"|fn_url}{/if}
{if $pattern.type == "news"}{"news.view?news_id=`$pattern.id`"|fn_url}{/if}
{if $pattern.type == "page"}{"pages.view?page_id=`$pattern.id`"|fn_url}{/if}
{/capture}
{if $addons.quick_search.show_product_images == "Y" && !$settings.General.search_objects}{include file="common_templates/image.tpl" image_width="40" image_height="40" images=$pattern.image object_type="product" obj_id=$pattern.id show_thumbnail="Y"} {/if}{$pattern.text.highlighted|unescape|default:$pattern.text.value}
{/foreach}
{else}
Just One bug if you have “Keep HTTPS connection once a secure page is visited” actived, the quick search doesn’t function for redirection.
I don’t know why