{$contact_name = $contact.name|escape|default:'[`(no name)`]'} {$contact_name} {* @event backend_customer.%plugin_id%.name_suffix *} {if !empty($backend_customer)}{foreach $backend_customer as $_}{ifset($_.name_suffix)}{/foreach}{/if}

{if !$wa->isSingleAppMode()}
{if $wa->crm} [`Open in CRM`] {else} [`Edit contact`] {/if}
{/if}
{* @event backend_customer.%plugin_id%.action_link *} {if !empty($backend_customer)} {foreach $backend_customer as $_} {if (!empty($_.action_link))} {$_.action_link} {/if} {/foreach} {/if}
{if !empty($contact['password'])} {if $contact.is_user} [`Permanent user account with Webasyst backend access`] {else} [`Permanent user account`] {/if}

[`Last login`]: {$contact.last_login_datetime|wa_datetime:"humandatetime"|default:'[`Never`]'}

{else} [`No permanent user account`]

{if $total_paid_num > 0} [`Guest checkout without signup`] {else} [`No activity in your store yet`] {/if}

{/if}
{if $contact['is_user'] <= 0}
{if empty($contact['password'])} [`Create a customer account`] {else} [`Reset password`] {/if}
{/if}
{if !empty($top) || !($contact.photo|strstr:".svg")}
{include file="./include.top_fields.html" top=$top similar_contacts=$similar_contacts need_other_values=true inline}
{/if} {* @event backend_customer.%plugin_id%.header *} {if !empty($backend_customer)}{foreach $backend_customer as $_}{ifset($_.header)}{/foreach}{/if}

{if $total_paid_num > 0} {$total_paid_str}
{if $days_ago < 1} [`Last paid order: today`] {else} {_w('Last paid order: %d day ago', 'Last paid order: %d days ago', $days_ago)} {/if} {else} [`No paid orders yet`] {/if}

{$orders_html|default:''}
{capture assign="review_list"} {foreach $reviews as $id => $review}
  • {include file="./../product/include.review.html" inline reply_allowed=false}
  • {/foreach} {/capture}

    [`Product reviews`]

    {if $reviews}
    {else}

    {sprintf('[`%s did not post any product reviews yet.`]', $contact_name)}

    {/if}

    [`Affiliate program`]

    {if !count($affiliate_history)}

    {sprintf('[`%s has no affiliate history yet.`]', $contact_name)}

    {/if} {if count($affiliate_history)} {foreach $affiliate_history as $h} {/foreach}
    [`Credit`] [`Debit`] [`Balance`]
    {if $h.order_id} [`Order`] {$wa->shop->orderId($h.order_id)} {/if} {if $h.comment} {$h.comment|escape} {/if} {if $h.amount > 0} + {$h.amount|wa_format_number:false} {/if} {if $h.amount < 0} − {abs($h.amount)|wa_format_number:false} {/if} {$h.balance|wa_format_number:false} {$h.create_datetime|wa_date:'humandatetime'}
    {/if}
    {* @event backend_customer.%plugin_id%.info_section *} {if !empty($backend_customer)}{foreach $backend_customer as $_}{ifset($_.info_section)}{/foreach}{/if}