ommercePurchasesRepository->createOrUpdateByClickDataAndOrder( $statistic->getClick(), $order ); } return true; } return false; } /** * Limit clicks to 'USE_CLICKS_SINCE_DAYS_AGO' range before order has been created. * * @param WC_Order $order * @return \WC_DateTime|null */ private function getFromDate(\WC_Order $order) { $fromDate = $order->get_date_created(); if (is_null($fromDate)) { return null; } $from = clone $fromDate; $from->modify(-self::USE_CLICKS_SINCE_DAYS_AGO . ' days'); return $from; } /** * @param ?string $email * @param \DateTimeInterface $from * @param \DateTimeInterface $to * @return StatisticsClickEntity[] */ private function getClicks(?string $email, \DateTimeInterface $from, \DateTimeInterface $to): array { if (!$email) return []; $subscriber = $this->subscribersRepository->findOneBy(['email' => $email]); if (!$subscriber instanceof SubscriberEntity) { return []; } return $this->statisticsClicksRepository->findLatestPerNewsletterBySubscriber($subscriber, $from, $to); } private function getSubscriberEmailFromCookie(): ?string { $cookieData = $this->cookies->get(Clicks::REVENUE_TRACKING_COOKIE_NAME); if (!$cookieData) { return null; } try { $click = $this->statisticsClicksRepository->findOneById($cookieData['statistics_clicks']); } catch (\Exception $e) { return null; } if (!$click instanceof StatisticsClickEntity) { return null; } $subscriber = $click->getSubscriber(); if ($subscriber instanceof SubscriberEntity) { return $subscriber->getEmail(); } return null; } }
Fatal error: Uncaught Error: Class "MailPoet\Statistics\Track\WooCommercePurchases" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:5852 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2622): MailPoetGenerated\FreeCachedContainer->getWooCommercePurchasesService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getHooksWooCommerceService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #3 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #5 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #6 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #7 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #8 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #9 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #11 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #12 /htdocs/index.php(17): require('/htdocs/wp-blog...') #13 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 5852