Commit Graph

16 Commits

Author SHA1 Message Date
Rodrigo Primo
206bd7fbab Fix layout error in the optin checkbox for some WP themes
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]
2023-06-01 11:38:54 +02:00
Rodrigo Primo
d6e0768e1f Change the behavior of the optin checkbox in the Woo checkout
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]
2023-05-30 13:25:24 +02:00
Brezo Cordero
c0ffcbac9b Opt out when subscription unchecked
This commit adds an action when customer unsubscribes to WooCommerce segment on checkout and opt outs Automate Woo customer.

[MAILPOET-4230]
2023-05-15 12:04:24 +02:00
alex-mailpoet
a9b4b57fd6 Merge checkout opt-ins from AutomateWoo and MailPoet
[MAILPOET-5057]
2023-03-06 11:22:58 +01:00
Jan Jakes
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Rodrigo Primo
6e399a5842 Replace getSubscribedSegments() with a new getSubscriberSegments() parameter
After the PR review, we decided to add a new $status parameter to
getSubscriberSegments() instead of creating getSubscribedSegments().

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
f21c47528e Use findBy() instead of getReference() to get segment entities
Initially, I had opted to use getReference() to avoid querying the
database to get the segment entities as all we need is the segment ID.
But I hadn't realized that this could cause problems if a segment that
is saved in the settings in the option woocommerce.segments is deleted.
Using findBy() here protects against this problem as, if the segment
doesn't exist anymore, it won't be returned.

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
5610295e7a Replace SubscriberSegment model with Doctrine code in Subscription
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
a428e16a09 Replace remaining uses of the Segment model with Doctrine in Subscription
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
d73e217eb1 Replace Paris models with Doctrine entities in Subscription::subscribeOnCheckout()
Besides Subscription::subscribeOnCheckout(), this commit also replaces
Paris models with Doctrine entities in all the methods that are called
by Subscription::subscribeOnCheckout().

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
24f55fdebc Use SubscriberEntity instead of the Subscriber model to get statuses
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
b225c22217 Replace Paris models with Doctrine entities in WooCommerceBlocksIntegration
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
David Remer
ac2646ce11 Fix str_replace to avoid broken HTML
[MAILPOET-4233]
2022-04-07 10:58:39 +02:00
David Remer
3320afe8f5 Remove wp_kses from templates
This commit removes two escaped outputs to keep backwards compatibility.

[MAILPOET-4219]
2022-04-04 17:12:33 +02:00
David Remer
a8d88beec9 Escape output according to WP sniffs
[MAILPOET-4129]
2022-04-04 17:12:33 +02:00
Jan Jakes
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00