X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to display total results for search (https://forum.x-cart.com/showthread.php?t=1582)

rockci 02-20-2003 07:03 PM

How to display total results for search
 
Can someone offer a tip on how to display the number of
matches found after executing the search on the search results or the navigation above it :roll: ?

funkydunk 02-21-2003 12:56 AM

post removed cos it was cr*p

funkydunk 02-21-2003 01:02 AM

sorry..no it wont.

have removed the previous post cos it didn't fully work.

Will put a new one in shortly.

funkydunk 02-21-2003 01:17 AM

Okay .. this will.

add the following line to search.php after the $smarty->assign("main","search");

Code:

        $smarty->assign("totalprod",$total_products_in_search);

new code for search_result.tpl:

Code:

{* $Id: search_result.tpl,v 1.10 2002/10/11 12:43:43 ambal Exp $ *}
{ include file="location.tpl" last_location=$lng.lbl_search_results}



Your search produced :

{$totalprod}
results.
</p>

{include file="customer/main/navigation.tpl"}
{capture name=dialog}
{include file="customer/main/products.tpl"}
{/capture}
{if $products ne ""}
{include file="dialog.tpl" title=$lng.lbl_search_results content=$smarty.capture.dialog extra="width=100%"}
{else}
{include file="dialog.tpl" title=$lng.lbl_search_results content="No matching products found" extra="width=100%"}
{/if}
{include file="customer/main/navigation.tpl"}

enjoy.

pomfret 02-21-2003 06:28 AM

Works like a charm :)

Thanks!


All times are GMT -8. The time now is 02:15 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.