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