{extends file="admin-layout.tpl"} {default_translation_domain domain='artabanmarketplace.bo.default'} {block name="no-return-functions"} {$admin_current_location = 'seller-customers'} {/block} {block name="page-title"}{intl l='Customer'}{/block} {block name="check-resource"}admin.artabanmarketplace.owner{/block} {block name="check-access"}view{/block} {block name="check-module"}ArtabanMarketplace{/block} {block name="main-content"}
{hook name="customer.top" location="customer_top" }
{if $removal_error }
{$error_message}
{/if} {loop name="amp_seller_link_admin" type="amp_seller_link_admin" admin_id={admin attr="id"}}

{intl l="My customers list"} {hook name="customers.caption" location="customer_list_caption" } {loop type="auth" name="can_create" role="ADMIN" resource="admin.customer" access="CREATE"} {/loop}
{ifloop rel="customer_list"}
{admin_sortable_header current_order=$customer_order order='reference' reverse_order='reference_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Reference'}" } | {admin_sortable_header current_order=$customer_order order='lastname' reverse_order='lastname_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Last name'}" } | {admin_sortable_header current_order=$customer_order order='firstname' reverse_order='firstname_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='First name'}" } {hook name="customers.header" location="customer_list_header" } | {admin_sortable_header current_order=$customer_order order='registration_date' reverse_order='registration_date_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Registration date'}" } | {intl l='Date of last order'} | {intl l='Last order amount'}
--- | --- | --- | --- | --- | ---
{loop name="customer_list" amp_seller_id=$SELLER_ID type="amp_seller_customer" current="false" visible="*" order=$customer_order backend_context="1" page=$page limit={config key="number_default_results_per_page.customer_list" default=20} search_term=$search search_in="ref,firstname,lastname,email"} {$lastOrderDate = ''} {$lastOrderAmount = ''} {$lastOrderCurrency = ''} {$hasOrders = false} {loop type="ampseller_order" amp_seller_id=$SELLER_ID name="last-order" customer=$ID order="create-date-reverse" limit="1"} {$lastOrderDate = {format_date date=$CREATE_DATE}} {$lastOrderAmount = {format_number number=$TOTAL_TAXED_AMOUNT}} {loop type="currency" name="order-currency" id=$CURRENCY} {$lastOrderCurrency = $SYMBOL} {$hasOrders = true} {/loop} {/loop}
{$REF} | {$LASTNAME} | {$FIRSTNAME} {hook name="customers.row" location="customer_list_row" customer_id={$ID}} | {format_date date=$CREATE_DATE} | {$lastOrderDate} | {$lastOrderCurrency} {$lastOrderAmount}
{/loop}
{include file = "includes/pagination.html" loop_ref = "customer_list" max_page_count = 10 page_url = {url path="/admin/customers" search_term=$search search_in="ref,firstname,lastname,email" customer_order=$customer_order} }
{/ifloop} {elseloop rel="customer_list"}
{intl l='You have no registred customers for the moment.'}
{/elseloop}

{hook name="customer.bottom" location="customer_bottom" } {/loop}
{/block}