This commit simplifies the logic of the 'used shipping method' segment
by removing the shipping method IDs from the queries. After some
considering, we have come to the conclusion that using just the shipping
method instance ID is enough.
[MAILPOET-4992]
This commit fixes an issue with the initial logic used to retrieve
shipping methods to build the UI of the 'used shipping method' segment.
It updates the code to properly retrieve WooCommerce shipping methods
configured for all zones. Before the code was getting just the shipping
method types and the shipping method instances.
The query that is used to get the subscribers that match this segment
will be updated in another commit.
[MAILPOET-4992]
This commit changes the behavior of
\MailPoet\Segments\WooCommerce::synchronizeRegisteredCustomer(). This
method is called when a new WooCommerce customer is created. Before, it
would always add the customer to the Woo segment expecting
\MailPoet\WooCommerce\Subscription::subscribeOnCheckout() to unsubscribe
the customer if the optin checkbox was not checked.
Since the behavior of the latter method changed in a previous commit and
it doesn't unsubscribe customers anymoreif the option checkbox is not
checked, the former method had to be updated to only subscribe the customer
if not in checkout context or if in checkout context and optin checkbox is
enabled and checked.
[MAILPOET-4178]
MailPoet adds a link to the WooCommerce task list pointing to its own
welcome wizard. We want to track users that arrive to the MP wizard from
WooCommerce but at this point tracking is not enabled. So we store the
information in a setting, and send the tracking event to Mixpanel, if it
is enabled, after the user completes the wizard.
[MAILPOET-4814]
We need to use the decimal separators selected by the user for our validation. We are also using the validation used on the adding/editing coupon page
MAILPOET-4762
It's possible that other plugins might define wc_get_page_id, so it's
more important to know that WC is installed/active than to know if the
function itself exists.
For good measure I'm including a cast to int even though the WC version
of the function always returns an integer. This is probably unnecessary
but it protects us from the possibility of the WC version of the
function returning something other than an integer in the future.
[MAILPOET-4834]