{* supreme 1.7.3 *} {$get = waRequest::get('get', 0, 'string')} {$query = waRequest::get('query', 0, 'string')} {$ajax = waRequest::get('ajax', 0, 'string')} {$ajaxRequest = waRequest::isXMLHttpRequest()} {if $ajaxRequest && $ajax} {* ajax search *} {if $products}
{foreach $products as $p}
{$wa->shop->productImgHtml($p, '96', ['alt' => $p.name || '', 'default' => "`$wa_theme_url`img/dummy200.png"])}
{$p.name}
{if $p.min_price != $p.max_price}
[`from`] {shop_currency_html($p.min_price)}
{else}
{shop_currency_html($p.price)}
{/if}
{if $p@index == 4} {break} {/if} {/foreach}
{if count($products) > 5} [`Show all results`] {/if} {/if} {elseif $get} {* favorites and viewed*} {if $get == 'favorites' || $get == 'viewed'} {if $get == 'favorites'} {$productListID = "favorites"} {$productListName = "shop_favorites"} {$productListTitle = "[`Favorites`]"} {elseif $get == 'viewed'} {$productListID = "viewed"} {$productListName = "shop_viewed"} {$productListTitle = "[`Viewed`]"} {/if} {$wa->title($productListTitle)} {$productListCookie = waRequest::cookie($productListName)} {if $productListCookie != null} {$productListIDsArr = explode(',', $productListCookie)} {$productList = array_replace(array_flip($productListIDsArr), $wa->shop->products("id/$productListCookie"))} {$productListIDsExistingArr = []} {foreach $productList as $key => $value} {if is_array($value)} {$productListIDsExistingArr[] = $key} {/if} {/foreach} {$productListIDsExisting = implode(',',$productListIDsExistingArr)} {else} {$productList = []} {$productListIDsExisting = false} {/if} {if empty($productListIDsExisting)} {else} {/if}

{$productListTitle}{if $productListIDsExisting && $productListIDsExisting != ""}{/if}

{if !empty($productListIDsExisting)} {include file='products-list.html' products=$productList remove=true showtoolbar=1 show_sort=0 show_per_page=0} {else}

[`Products list is empty`]


{/if}
{/if} {else} {* search page *} {if $wa->currentUrl()|strstr:'search' && !empty($query)} {$title = '[`Results for "%s"`]'|replace:'%s':$query} {/if} {if !empty($title)}

{$title|escape}

{/if} {if empty($theme_settings.debug_disable_shop_frontend_search) && empty($theme_settings.debug_disable_shop_all) && empty($theme_settings.debug_disable_all_hooks)} {* @event frontend_search.%plugin_id% *} {foreach $frontend_search as $_}{$_}{/foreach} {/if} {if !$products}

[`No products were found.`]

{else}
{include file='products-list.html' showpagination=1 showtoolbar=1 sorting=1}
{/if} {/if}