AbstractAutomationEmbed.php
5 months ago
Automation.php
2 years ago
AutomationAnalytics.php
2 months ago
AutomationEditor.php
2 months ago
AutomationFlowEmbed.php
6 months ago
AutomationPreviewEmbed.php
2 months ago
AutomationTemplates.php
2 years ago
CustomFields.php
2 months ago
DynamicSegments.php
2 months ago
ExperimentalFeatures.php
3 years ago
FormEditor.php
1 week ago
Forms.php
2 months ago
Help.php
2 months ago
Homepage.php
2 years ago
Landingpage.php
2 years ago
Logs.php
1 month ago
NewsletterEditor.php
2 months ago
Newsletters.php
2 months ago
Settings.php
5 months ago
StaticSegments.php
2 months ago
Subscribers.php
1 week ago
SubscribersExport.php
3 years ago
SubscribersImport.php
2 months ago
Tags.php
2 months ago
Upgrade.php
1 year ago
WelcomeWizard.php
2 months ago
WooCommerceSetup.php
2 months ago
index.php
3 years ago
WooCommerceSetup.php
42 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\AdminPages\Pages; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\AdminPages\PageRenderer; |
| 9 | use MailPoet\Config\Menu; |
| 10 | use MailPoet\WooCommerce\Helper; |
| 11 | use MailPoet\WP\Functions as WPFunctions; |
| 12 | |
| 13 | class WooCommerceSetup { |
| 14 | /** @var PageRenderer */ |
| 15 | private $pageRenderer; |
| 16 | |
| 17 | /** @var WPFunctions */ |
| 18 | private $wp; |
| 19 | |
| 20 | /** @var Helper */ |
| 21 | private $wooCommerceHelper; |
| 22 | |
| 23 | public function __construct( |
| 24 | PageRenderer $pageRenderer, |
| 25 | Helper $wooCommerceHelper, |
| 26 | WPFunctions $wp |
| 27 | ) { |
| 28 | $this->pageRenderer = $pageRenderer; |
| 29 | $this->wooCommerceHelper = $wooCommerceHelper; |
| 30 | $this->wp = $wp; |
| 31 | } |
| 32 | |
| 33 | public function render() { |
| 34 | if (wp_doing_ajax()) return; |
| 35 | $data = [ |
| 36 | 'finish_wizard_url' => $this->wp->adminUrl('admin.php?page=' . Menu::MAIN_PAGE_SLUG), |
| 37 | 'show_customers_import' => $this->wooCommerceHelper->getCustomersCount() > 0, |
| 38 | ]; |
| 39 | $this->pageRenderer->displayPage('woocommerce_setup.html', $data); |
| 40 | } |
| 41 | } |
| 42 |