This fixes an issue where pre-existing subscribedDate filters were
causing errors because they didn't have an `action` stored in their
serialized data.
It was never necessary to store the action redundantly in the serialized
filter data in the first place, so we're now fetching the action
directly from the filter data entity itself.
MAILPOET-5500
This commit refactors the React components SingleOrderValueFields and
TotalSpentFields to use the new DaysPeriodField component instead of
its own code to generate the days period selector.
[MAILPOET-4991]
This commit refactors the React components AverageSpentFields and
NumberOfOrdersFields to use the new DaysPeriodField component instead of
a its own code to generate the days period selector.
[MAILPOET-4991]
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 changes the logic of the code that builds the queries for
the 'used shipping method' filter. The initial implementation relied
only on the shipping method name that is stored in
wp_woocommerce_order_items. This implementation did not work as the
name is not unique. The new implementation use the shipping method id
and the instance id that are stored in wp_woocommerce_order_itemmeta and
the combination of both fields is unique.
[MAILPOET-4992]
There was a bug in the query that is used to get the subscribers that
opened emails that was preventing it from working when trying to get
subscribers that opened zero emails.
The problem was that we were adding the user_agent_type as a condition
on the WHERE part of the clause. Meaning that it was being used to
filter the overall results and thus excluding all subscribers that had
no entries in the wp_mailpoet_statistics_opens table. By moving this
condition to the ON clause in the LEFT JOIN, we use the user_agent_type
field to match rows between tables. The value of this field will still
be taken into consideration when counting the number of opens as we are
counting the number of entries in the wp_mailpoet_statistics_opens
table.
[MAILPOET-5347]
This commit changes the behavior of the country segment to include
subscribers that never placed an order (or placed orders that failed or
were canceled) as long as they have a country set in the WooCommerce
customer lookup table.
[MAILPOET-4188]
A unintentional side-effect in Woo core < 7.6 synched the customer
lookup table immediately after the creation of an order. This
unintentional behavior was removed in Woo 7.6 and now we need to call
\Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore::sync_order_customer()
explicitly for Woo to add to the customer lookup table.
Without this change, a few tests in WooCommerceCountryTest were failing
when running with Woo 7.6. As far as I could check this change does not
affect anything else in MP other than the tests.
[MAILPOET-5148]