Commit Graph

33 Commits

Author SHA1 Message Date
841745c706 Remove shipping method IDs from the 'used shipping method' query
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]
2023-07-04 22:23:06 +02:00
f85b7a52fc Change logic of the code to build the 'used shipping method' segment UI
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]
2023-07-04 22:23:06 +02:00
243c096643 Add UI for new "used shipping method" segment
[MAILPOET-4992]
2023-07-04 22:23:06 +02:00
190da3b0e5 Use WooCommerce wrapper instead of native functions, test if WC is active
[MAILPOET-5092]
2023-07-03 12:44:07 +02:00
54e6e11cf0 Fix latest coupon fetching logic
[MAILPOET-5169]
2023-06-19 11:06:23 +02:00
cd43cfbb1f Fix typo
[MAILPOET-4178]

Co-authored-by: John Oleksowicz <8656640+johnolek@users.noreply.github.com>
2023-05-30 13:25:24 +02:00
80655813b7 Stop subscribing customers to the Woo list when they are created
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]
2023-05-30 13:25:24 +02:00
ec68818c1a Add filter for used payment method
MAILPOET-4993
2023-05-19 11:57:13 +02:00
e081c554aa Add method to retrieve order statuses
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
847132b433 Create new component for existing coupons
[MAILPOET-4890]
2023-02-22 13:07:40 +01:00
3b5a96a3f7 Add test case that coupon is rendered correctly
[MAILPOET-4984]
2023-02-01 11:21:49 +01:00
8a4f5c13da Add tracking for users arriving to the wizard from WooCommerce
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]
2023-01-30 15:01:42 +01:00
494723c818 Use WooCommerce decimal separators when validating input fields
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
2023-01-30 11:48:48 +01:00
1730578a23 Use coupon id instead of text
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
40f4216ff8 Add method for getting WC coupons
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
39d22bdd62 Move Coupon instantiation to MailPoet\WooCommerce\Helper
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
48c075b730 Add WC helper function to retrieve coupon code from id
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
199910a52f Add coupon block config
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
761f7c6537 Prevent issues if other plugins define WC function
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]
2022-11-30 11:03:40 +01:00
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
b6e7e39fb0 Rename method and move wcGetPageId to Woo helper class
MAILPOET-4663
2022-11-01 14:58:47 +01:00
9df99b1a00 Add method for getting customers count to WooCommerce helper
[MAILPOET-4652]
2022-10-24 15:16:04 +02:00
dd1fcd5100 Add helper method to get the name of the WooCommerce order addresses table
[MAILPOET-4711]
2022-10-19 11:32:41 +02:00
f734091e34 Replace PHP's builtin exception with Mailpoet's RuntimeException
Use a more specific exception.

[MAILPOET-4577]
2022-10-05 10:47:06 +02:00
ff105f8e61 Add helper method to get the name of the WooCommerce orders table
[MAILPOET-4577]
2022-10-05 10:47:06 +02:00
b592ce743d Use Woo native function instead of custom query in getOrdersCountCreatedBefore()
[MAILPOET-4570]
2022-10-03 15:10:36 +02:00
842f81d40b Add method to detected if WooCommerce Custom Order Tables is enabled
[MAILPOET-4567]
2022-09-09 10:43:11 +02:00
90dcbc2749 Add create order to WC helper
MAILPOET-4566
2022-09-08 13:02:52 +02:00
de4e76b65d Use is_array() instead of !empty() for a safer check
Just in case the option is changed and is not an array anymore.

[MAILPOET-4491]
2022-08-04 10:18:44 +02:00
13e06fe0cb Add helper method to check if MailPoet was installed via WooCommerce
The method will return true if MailPoet was installed via the
WooCommerce onboarding wizard and false otherwise.

[MAILPOET-4491]
2022-08-04 10:18:44 +02:00
9f39843189 Sanitize incoming data according to WP sniffer
[MAILPOET-4219]
2022-04-04 17:12:33 +02:00
a2ab1a3cfd Escape queries before passing to $wpdb methods
[MAILPOET-4219]
2022-04-04 17:12:33 +02:00
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00