Add getOrdersCount() to WooCommerce helper

[MAILPOET-1732]
This commit is contained in:
Rostislav Wolny
2019-03-22 11:56:19 +01:00
committed by M. Shull
parent 74bee5ec1e
commit 29e2cebce3
5 changed files with 53 additions and 4 deletions

View File

@@ -8,13 +8,17 @@ use MailPoet\Settings\SettingsController;
use MailPoet\WooCommerce\Helper as WooCommerceHelper;
use MailPoetVendor\Twig\Extension\AbstractExtension;
use MailPoetVendor\Twig\TwigFunction;
use \MailPoet\WP\Functions as WPFunctions;
if (!defined('ABSPATH')) exit;
class Analytics extends AbstractExtension {
public function getFunctions() {
$settings = new SettingsController();
$analytics = new AnalyticsGenerator(new Reporter($settings, new WooCommerceHelper), $settings);
$analytics = new AnalyticsGenerator(
new Reporter($settings, new WooCommerceHelper(new WPFunctions())),
$settings
);
return array(
new TwigFunction(
'get_analytics_data',