The aim is to make both the MPMarketingChannelController and the MPMarketingChannel class lighter by moving most of the data request feature to the MPMarketingChannelDataController class
MAILPOET-5698
For ease of lookup, I changed the helper to return an array with keys
corresponding to the instanceId of the shipping methods. I couldn't see
anywhere else in the codebase where the keys would have mattered.
MAILPOET-5625
Because I haven't found an easy way how to use WP or WC API,
I decided to create a MailPoet endpoint for getting coupons that
allows me loading them via Ajax.
[MAILPOET-5123]
Selected shipping methods were not appearing when after saving and
reloading a segment because the instanceIds were actually coming through
as integers, while the values are getting saved as strings.
MAILPOET-5496
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 fix a layout error in the optin checkbox that MailPoet adds
to the WooCommerce checkout when the site is using the themes Twenty
Twenty-Two and Twenty Twenty-Three.
This problem was happening because WooCommerce add CSS to make its own
checkboxes work with those two themes, but it broke checkboxes the
layout of checkboxes created with woocommerce_form_field().
The Woo checkboxes in the checkout display the text inside an <span>
element and that doesn't happen for checkboxes created with
woocommerce_form_field(). The problem is in those CSS rules:
0ea5205672/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss (L731-L757)
[MAILPOET-4133]
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]
This commit changes the behavior of the optin checkbox that MailPoet
adds to the WooCommerce checkout.
Now the checkbox is not checked by default for logged in users who
already subscribed to a list. Also, users won't be unsubscribed anymore
and have their global status change to unsubscribed if they uncheck the
checkbox.
The only action that is performed after this change is to subscribe
users if they check the checkbox.
This change was implemented both for the normal checkout and the block
checkout.
It was also necessary to remove the AutomateWoo integration that
depended on subscribers being unsubscribed during checkout.
[MAILPOET-4178]