Add a feature flag [MAILPOET-1483]
This commit is contained in:
@@ -157,6 +157,9 @@ class Hooks {
|
||||
}
|
||||
|
||||
function setupWooCommerceSubscriptionEvents() {
|
||||
if (!$this->settings->get('woo_commerce_list_sync_enabled')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$woocommerce = $this->settings->get('woocommerce', []);
|
||||
// WooCommerce: subscribe on checkout
|
||||
|
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
require_once __DIR__ . '/../DataFactories/Settings.php';
|
||||
|
||||
use MailPoet\Test\DataFactories\Settings;
|
||||
|
||||
class WooCommerceSettingsTabCest {
|
||||
|
||||
function _before(\AcceptanceTester $I) {
|
||||
$I->activateWooCommerce();
|
||||
$this->settings_factory = new Settings();
|
||||
$this->settings_factory->withWooCommerceListImportPageDisplayed(true);
|
||||
$this->settings_factory->withWooCommerceListSyncEnabled();
|
||||
}
|
||||
|
||||
function checkWooCommerceTabExists(\AcceptanceTester $I) {
|
||||
|
@@ -15,6 +15,7 @@ class SubscriptionTest extends \MailPoetTest {
|
||||
$this->order_id = 123; // dummy
|
||||
$this->subscription = ContainerWrapper::getInstance()->get(Subscription::class);
|
||||
$this->settings = new SettingsController();
|
||||
$this->settings->set('woo_commerce_list_sync_enabled', 1);
|
||||
$this->wc_segment = Segment::getWooCommerceSegment();
|
||||
|
||||
$subscriber = Subscriber::create();
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<table class="form-table">
|
||||
<% if settings.woo_commerce_list_sync_enabled %>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="settings[woocommerce_optin_on_checkout]">
|
||||
@@ -45,6 +46,7 @@
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<% endif %>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="settings[mailpoet_subscribe_old_woocommerce_customers]">
|
||||
|
Reference in New Issue
Block a user