Dashboard widgets
If the dashboard (typo3/) is installed, the extension adds the
following widgets to the widget group "Cart":
- Orders per Day: number of paid but not shipped orders per day
- Turnover per Day: gross total of all orders per day
- Latest Orders (paid, not shipped): the ten latest paid but not shipped orders with a link to the order in the backend module
The widgets only show orders in storage folders the backend user may show (page permissions and mount points), admins see all orders.
Configuration of the data providers
The data of the widgets comes from data providers, which are configured in the service configuration of the extension:
extcode.(cart. provider. orders_ per_ day Extcode)Cart Widgets Provider Orders Per Day Provider extcode.(cart. provider. turnover_ per_ day Extcode)Cart Widgets Provider Turnover Per Day Provider extcode.(cart. provider. payment_ paid_ shipping_ open Extcode)Cart Widgets Provider Order Items Provider
To change the options, overwrite the service in the Configuration/
of your site package. The site package has to depend on extcode/, so its
service configuration is loaded afterwards.
<?php
declare(strict_types=1);
use Extcode\Cart\Widgets\Provider\TurnoverPerDayProvider;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $configurator): void {
$configurator->services()
->set('extcode.cart.provider.turnover_per_day')
->class(TurnoverPerDayProvider::class)
->autowire()
->arg('$options', [
'days' => 14,
'storagePids' => [105],
'filter' => [
'payment' => [
'status' => 'paid',
],
],
]);
};
The same way you can register further widgets with own identifiers, e.g. a second turnover widget for another storage folder.
Options of all providers
-
- Type
-
array
- Default
-
[]
Status the payment and/or the shipping of an order must have, e.g.
['payment' =>. All orders are taken into account if empty.['status' => 'paid'], 'shipping' => ['status' => 'open']]
-
- Type
-
array or comma separated string of page uids
- Default
-
[]
Storage folders of the orders. All storage folders are taken into account if empty. In both cases only storage folders the backend user may show are used.
Fields of the following options are fields of the order
(tx_), with or without the table name. Other
fields throw an exception.
Options of OrdersPerDayProvider and TurnoverPerDayProvider
-
- Type
-
int
- Default
-
28
Number of days before today shown in the chart.
-
- Type
-
string
- Default
-
order_date
Date field of the order which assigns the order to a day.
Options of TurnoverPerDayProvider
-
- Type
-
string
- Default
-
total_gross
Field of the order which is summed up, e.g.
total_.net
Options of OrderItemsProvider
-
- Type
-
string
- Default
-
crdate
Field to sort the orders by.
-
- Type
-
string
- Default
-
desc
Sort direction,
ascordesc.
-
- Type
-
int
- Default
-
10
Number of orders in the list.