AmplitudeProvider.php
2 months ago
AssetsProvider.php
11 months ago
BlocksProvider.php
3 months ago
ClientProvider.php
2 months ago
ContainerProvider.php
11 months ago
DatabaseProvider.php
8 months ago
HostingRoutesProvider.php
2 months ago
IntegrationsProvider.php
5 months ago
JobsProvider.php
7 months ago
MenusProvider.php
11 months ago
NoticesProvider.php
4 months ago
ProviderInterface.php
11 months ago
RedirectsProvider.php
11 months ago
RoutesProvider.php
9 months ago
SurveysProvider.php
2 months ago
TrackingProvider.php
8 months ago
WebhooksProvider.php
8 months ago
WpdbProvider.php
11 months ago
TrackingProvider.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Hostinger\Reach\Providers; |
| 4 | |
| 5 | use Hostinger\Reach\Api\Webhooks\Handlers\CartAbandoned; |
| 6 | use Hostinger\Reach\Container; |
| 7 | use Hostinger\Reach\Functions; |
| 8 | use Hostinger\Reach\Repositories\CartRepository; |
| 9 | use Hostinger\Reach\Tracking\AbandonedCarts; |
| 10 | |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | die; |
| 13 | } |
| 14 | |
| 15 | class TrackingProvider implements ProviderInterface { |
| 16 | public function register( Container $container ): void { |
| 17 | $container->set( |
| 18 | AbandonedCarts::class, |
| 19 | function () use ( $container ) { |
| 20 | return new AbandonedCarts( |
| 21 | $container->get( CartRepository::class ), |
| 22 | $container->get( CartAbandoned::class ), |
| 23 | $container->get( Functions::class ) |
| 24 | ); |
| 25 | } |
| 26 | ); |
| 27 | |
| 28 | $abandoned_carts = $container->get( AbandonedCarts::class ); |
| 29 | $abandoned_carts->init(); |
| 30 | } |
| 31 | } |
| 32 |