Add a feature flag [MAILPOET-1483]

This commit is contained in:
wxa
2019-04-29 14:07:00 +03:00
committed by M. Shull
parent 26cbd79535
commit ecf0fe63c0
4 changed files with 13 additions and 0 deletions

View File

@@ -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

View File

@@ -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) {

View File

@@ -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();

View File

@@ -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]">