{$query = $query|default:''} {$category_id = $category_id|default:null} {$filter_id = $filter_id|default:null} {capture assign="customers_list"} {foreach $customers as $c}

{$c.name|default:'[`(no name)`]'|escape} {foreach $c.categories as $cc} {if $cc.icon && !($cc.system_id == 'shop')} {* no need for 100500 similar shop-script icons here *} {$wa->shop->getIcon($cc.icon)} {/if} {/foreach} {if $c.is_user} {/if}

{include file="./include.top_fields.html" top=$c['top']|default:[] similar_contacts=$c['similar_contacts']|default:[] need_other_values=false inline}

{if !empty($c.address.country)}   {/if} {ifset($c.address.city, '')|escape}{if !empty($c.address.city) && !empty($c.address.region)},{/if} {ifset($c.address.region_formatted, ifset($c.address.region, ''))|escape} {ifset($c.address.zip, '')|escape} {ifset($c.address.street, '')|escape}

{waCurrency::format('%0{h}', $c.total_spent, $wa->shop->currency())} {if $c.affiliate_bonus>=0}+{/if}{$c.affiliate_bonus} {$c.number_of_orders|default:''} {if $c.last_order_id} {$wa->shop->orderId($c.last_order_id)}
{$c.last_order_datetime|wa_datetime:"humandate"}
{else} {/if} {$c.create_datetime|wa_date} {/foreach} {/capture} {capture assign="lazy_load_block"}

{_w('%d contact','%d contacts', min($offset + $count, $total_count))} {sprintf(_w('of %d'), $total_count)}

= $total_count}style="display:none;"{/if}>[`Show more customers`]
{/capture} {if $in_lazy_process}
{$customers_list}
{$lazy_load_block}
{else}

{$title|escape|default:"[`New search`]"}

{if $hash_start === "#/all/" || $hash_start === "#/shop/"} {else}
{if $category_id} [`Edit`] {/if} {if $query} [`Save this search`] [`Change search conditions`] {elseif $filter_id} [`Edit`] {/if}
{/if}
{* @event backend_customers_list.%plugin_id%.top_li *} {if !empty($backend_customers_list)}{foreach $backend_customers_list as $_}{if (!empty($_.top_li))}{$_.top_li}{/if}{/foreach}{/if}
{if $query || $filter_id} {include file="./include.filterSettings.html"} {/if} {if $hash_start === "#/shop/"}

[`Everyone who’ve ever placed an order or signed up on your storefront.`]

{elseif $hash_start === "#/all/"}

[`All contacts and backend users gathered across all Webasyst apps.`]

{/if} {if !empty($customers)}
{foreach $cols as $col_id => $col_name} {/foreach} {$customers_list}
{$col_name}{if $col_id == 'total_spent'} (LTV){/if}
{else} {* Fake table. A need to take a certain width so that the interface does not swell when there is no table *}
{foreach $cols as $col_id => $col_name} {/foreach}
{/if} {$lazy_load_block}
{/if}