{if $graph_data === null}

[`Best selling products and services`] [`Custom range`]

{else}

[`Sales`] [`Custom range`]

{/if}
{* * Right sidebar with a pie chart *} {* * Content on the left *}
{if $top_products} {* * Best selling products table *} {if $wa->shop->config('enable_2x')} {$size = '48x48@2x'} {else} {$size = '48x48'} {/if} {$rows_show_immidiately = 10} {foreach $top_products as $p} {if $p@index == $rows_show_immidiately - 1} {/if} = $rows_show_immidiately - 1} style="display:none;"{/if}> {/foreach}
{if $request_options.sort == 'quantity'} [`Quantity`] {else} [`Quantity`] {/if} {if $request_options.sort == 'sales'} [`Sales`] {else} [`Sales`] {/if} {if $request_options.sort == 'profit'} [`Profit`] {else} [`Profit`] {/if}
[`Show more products`]
{$wa->shop->getProductImgHtml($p, $size, ['height' => 48, 'width' => 48])} {$p.name|escape} {$p.quantity} {wa_currency_html($p.sales, $def_cur)} {wa_currency_html($p.profit, $def_cur)} 0} title="{sprintf('[`Profit percentage = Net profit (%s) / Cost price (%s) = %s%%`]', wa_currency($p.profit, $def_cur), wa_currency($p.sales - $p.profit, $def_cur), round( 100 * $p.profit / ($p.sales - $p.profit)) )}"{/if}> {strip}
{/strip}
{* * Best selling services table *}

[`Services`]

{if $top_services} {foreach $top_services as $s} {/foreach}
{$s.name|escape} +{wa_currency_html($s.total, $def_cur)}
+{wa_currency_html($service_total_val, $def_cur)} {sprintf('[`+%s%% to average order value`]', $service_total_percent)}
{else}

{sprintf('[`On the selected time period, there were no orders with extra services.`]', $wa_app_url|cat:'?action=products#/services/')}

{/if} {else}

[`There were no products sold on the selected period.`]

{/if}