{capture name="shop_information_block_content"}
{loop name="amp_seller_link_admin" type="amp_seller_link_admin" admin_id={admin attr="id"}}
<div class="stats col-md-3 col-xs-4">
    <a href="{url path='/admin/module/artabanmarketplace/seller/catalog'}">
        <h2>{count type="ampseller_product" visible="*" amp_seller_id=$SELLER_ID backend_context="1"}</h2>
        <p>{intl l="Products" d='hookadminhome.bo.default'}</p>
    </a>
</div>
<div class="stats col-md-3 col-xs-4">
    <a href="{url path='/admin/module/artabanmarketplace/seller/catalog'}">
        <h2>{count type="ampseller_product" visible="true" amp_seller_id=$SELLER_ID backend_context="1"}</h2>
        <p>{intl l="Online products" d='hookadminhome.bo.default'}</p>
    </a>
</div>
<div class="stats col-md-3 col-xs-4">
    <a href="{url path='/admin/module/artabanmarketplace/seller/catalog'}">
        <h2>{count type="ampseller_product" visible="false" amp_seller_id=$SELLER_ID backend_context="1"}</h2>
        <p>{intl l="Offline products" d='hookadminhome.bo.default'}</p>
    </a>
</div>
<div class="stats col-md-3 col-xs-4">
    <a href="{url path='/admin/module/artabanmarketplace/seller/catalog'}">
        <h2>{count type="ampseller_order" amp_seller_id=$SELLER_ID backend_context="1"}</h2>
        <p>{intl l="Orders" d='hookadminhome.bo.default'}</p>
    </a>
</div>

{/loop}
{/capture}


{if trim($smarty.capture.shop_information_block_content) ne ""}
<div class="general-block-decorator" id="block-information">
    <div class="row">
        {$smarty.capture.shop_information_block_content nofilter}
    </div>
</div>
{/if}

{capture name="sell_information_block_content"}
{loop name="amp_seller_link_admin" type="amp_seller_link_admin" admin_id={admin attr="id"}}
<div class="stats col-md-4 col-xs-4">
    <div class="table-responsive">
        <h3>{intl l="Today"  d='hookadminhome.bo.default'}</h3>
        <table class="table table-striped">
            <tbody>
                <tr>
                    <th>{intl l="Overall sales"  d='hookadminhome.bo.default'}</th>
                    {assign "todayOverallSales" 0}                    
                    {loop type="ampseller_order" name="order-todayOverallSales" amp_seller_id="$SELLER_ID" interval_creation_order="today"}
                    {assign "todayOverallSales" $todayOverallSales+$TOTAL_TAXED_AMOUNT_POSTAGE}
                    {assign "todayOverallSalesCounter" $todayOverallSalesCounter+1}
                    {/loop}
                    <td>{format_money number=$todayOverallSales symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Sales excluding shipping" d='hookadminhome.bo.default'}</th>
                    {assign "todayOverallSalesExcludingShipping" 0}
                    {assign "todayOverallSalesExcludingShippingCounter" 0}
                    {loop type="ampseller_order" name="order-todayOverallSalesExcludingShipping" amp_seller_id=$SELLER_ID interval_creation_order="today"}
                    {assign "todayOverallSalesExcludingShipping" $todayOverallSalesExcludingShipping+$TOTAL_TAXED_AMOUNT}
                    {assign "todayOverallSalesExcludingShippingCounter" $todayOverallSalesExcludingShippingCounter+1}
                    {/loop}
                    <td>{format_money number=$todayOverallSalesExcludingShipping symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Yesterday sales"  d='hookadminhome.bo.default'}</th>
                    {assign "yesterdayOverallSales" 0}
                    {loop type="ampseller_order" name="order-yesterdayOverallSales" amp_seller_id="$SELLER_ID" interval_creation_order="yesterday"}
                    {assign "yesterdayOverallSales" $yesterdayOverallSales+$TOTAL_TAXED_AMOUNT}
                    {/loop}
                    <td>{format_money number=$yesterdayOverallSales symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Orders" d='hookadminhome.bo.default'}</th>
                    <td>
                        {count type="ampseller_order" amp_seller_id="$SELLER_ID" interval_creation_order="today"}
                    </td>
                </tr>
                <tr>
                    <th>{intl l="Average cart" d='hookadminhome.bo.default'}</th>                    
                    <td>{if $todayOverallSalesExcludingShippingCounter == 0}
                        {format_money number=0 symbol=$defaultCurrency}
                        {else}
                        {format_money number={($todayOverallSalesExcludingShipping/$todayOverallSalesExcludingShippingCounter)|round:"2"} symbol=$defaultCurrency}
                        {/if}
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="stats col-md-4 col-xs-4">
    <div class="table-responsive">
        <h3>{intl l="This month"  d='hookadminhome.bo.default'}</h3>
        <table class="table table-striped">
            <tbody>
                <tr>
                    <th>{intl l="Overall sales"  d='hookadminhome.bo.default'}</th>
                    {assign "thisMonthOverallSales" 0}                    
                    {loop type="ampseller_order" name="order-thisMonthOverallSales" amp_seller_id="$SELLER_ID" interval_creation_order="this_month"}
                    {assign "thisMonthOverallSales" $thisMonthOverallSales+$TOTAL_TAXED_AMOUNT_POSTAGE}
                    {/loop}
                    <td>{format_money number=$thisMonthOverallSales symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Sales excluding shipping" d='hookadminhome.bo.default'}</th>
                    {assign "thisMonthOverallSalesExcludingShipping" 0}
                    {assign "thisMonthOverallSalesExcludingShippingCounter" 0}
                    {loop type="ampseller_order" name="order-thisMonthOverallSalesExcludingShipping" amp_seller_id=$SELLER_ID interval_creation_order="this_month"}
                    {assign "thisMonthOverallSalesExcludingShipping" $thisMonthOverallSalesExcludingShipping+$TOTAL_TAXED_AMOUNT}
                    {assign "thisMonthOverallSalesExcludingShippingCounter" $thisMonthOverallSalesExcludingShippingCounter+1}
                    {/loop}
                    <td>{format_money number=$thisMonthOverallSalesExcludingShipping symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Previous month sales" d='hookadminhome.bo.default'}</th>
                    {assign "previousMonthOverallSalesExcludingShipping" 0}
                    {loop type="ampseller_order" name="order-previousMonthOverallSalesExcludingShipping" amp_seller_id=$SELLER_ID interval_creation_order="previous_month"}
                    {assign "previousMonthOverallSalesExcludingShipping" $previousMonthOverallSalesExcludingShipping+$TOTAL_TAXED_AMOUNT}
                    {/loop}
                    <td>{format_money number=$previousMonthOverallSalesExcludingShipping symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Orders" d='hookadminhome.bo.default'}</th>
                    <td>
                        {count type="ampseller_order" amp_seller_id="$SELLER_ID" interval_creation_order="this_month"}
                    </td>
                </tr>
                <tr>
                    <th>{intl l="Average cart" d='hookadminhome.bo.default'}</th>                    
                    <td>{if $thisMonthOverallSalesExcludingShippingCounter == 0}
                        {format_money number=0 symbol=$defaultCurrency}
                        {else}
                        {format_money number={($thisMonthOverallSalesExcludingShipping/$thisMonthOverallSalesExcludingShippingCounter)|round:"2"} symbol=$defaultCurrency}
                        {/if}
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="stats col-md-4 col-xs-4">
    <div class="table-responsive">
        <h3>{intl l="This year"  d='hookadminhome.bo.default'}</h3>
        <table class="table table-striped">
            <tbody>
                <tr>
                    <th>{intl l="Overall sales"  d='hookadminhome.bo.default'}</th>
                    {assign "thisYearOverallSales" 0}                    
                    {loop type="ampseller_order" name="order-thisYearOverallSales" amp_seller_id="$SELLER_ID" interval_creation_order="this_year"}
                    {assign "thisYearOverallSales" $thisYearOverallSales+$TOTAL_TAXED_AMOUNT_POSTAGE}
                    {/loop}
                    <td>{format_money number=$thisMonthOverallSales symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Sales excluding shipping" d='hookadminhome.bo.default'}</th>
                    {assign "thisYearOverallSalesExcludingShipping" 0}
                    {assign "thisYearOverallSalesExcludingShippingCounter" 0}
                    {loop type="ampseller_order" name="order-thisYearOverallSalesExcludingShipping" amp_seller_id=$SELLER_ID interval_creation_order="this_year"}
                    {assign "thisYearOverallSalesExcludingShipping" $thisYearOverallSalesExcludingShipping+$TOTAL_TAXED_AMOUNT}
                    {assign "thisYearOverallSalesExcludingShippingCounter" $thisYearOverallSalesExcludingShippingCounter+1}
                    {/loop}
                    <td>{format_money number=$thisYearOverallSalesExcludingShipping symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Previous year sales" d='hookadminhome.bo.default'}</th>
                    {assign "previousYearOverallSalesExcludingShipping" 0}
                    {loop type="ampseller_order" name="order-previousMonthOverallSalesExcludingShipping" amp_seller_id=$SELLER_ID interval_creation_order="previous_year"}
                    {assign "previousYearOverallSalesExcludingShipping" $previousYearOverallSalesExcludingShipping+$TOTAL_TAXED_AMOUNT}
                    {/loop}
                    <td>{format_money number=$previousYearOverallSalesExcludingShipping symbol=$defaultCurrency}</td>
                </tr>
                <tr>
                    <th>{intl l="Orders" d='hookadminhome.bo.default'}</th>
                    <td>
                        {count type="ampseller_order" amp_seller_id="$SELLER_ID" interval_creation_order="this_year"}
                    </td>
                </tr>
                <tr>
                    <th>{intl l="Average cart" d='hookadminhome.bo.default'}</th>                    
                    <td>{if $thisYearOverallSalesExcludingShippingCounter == 0}
                        {format_money number=0 symbol=$defaultCurrency}
                        {else}
                        {format_money number={($thisYearOverallSalesExcludingShipping/$thisYearOverallSalesExcludingShippingCounter)|round:"2"} symbol=$defaultCurrency}
                        {/if}
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
{/loop}
{/capture}

{if trim($smarty.capture.sell_information_block_content) ne ""}
<div class="general-block-decorator" id="block-information">
    <div class="row">
        {$smarty.capture.sell_information_block_content nofilter}
    </div>
</div>
{/if}
