Commit Graph

29 Commits

Author SHA1 Message Date
wxa
dd6aff01db Fix duplicate automatic email for same product
[MAILPOET-3254]

It was happening when a second order was placed which contained the same product and some additional product.
2021-03-29 10:32:37 +02:00
Rodrigo Primo
575b34fc97 Fix "Purchased In This Category" email for product variations
The "Purchased In This Category" email was not working for variable
products. This was happening because MailPoet calls
WC_Product::get_category_ids() to get the list of WooCommerce
categories associated with a given product, but this method doesn't work
for product variations (see
https://github.com/woocommerce/woocommerce/issues/12942).

In this commit, I'm implementing a workaround. I changed the code to
check if the product is a product variation and, if so, get the
categories from the parent product instead of the product itself. But I
also plan to raise this issue with the WooCommerce team as, in my opinion,
it is odd that WC_Product::get_category_ids() doesn't work with product
variations and fails silently.

[MAILPOET-3416]
2021-03-01 13:32:52 +01:00
Jan Lysý
df794425b7 Remove phpstan-ignores from tests
[MAILPOET-3235]
2021-01-18 14:39:42 +01:00
Jan Lysý
922c52f7df Remove phpstan errors from the rest of the tests
[MAILPOET-3235]
2021-01-18 14:39:42 +01:00
Rostislav Wolny
5d03ca01cd Fix WooCommerce helper mock in first purchase tests
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Pavel Dohnal
f8bd946dc0 Check sent emails for products when schedulig an email
[MAILPOET-2335] [MAILPOET-2334]
2020-10-22 11:54:41 +02:00
Pavel Dohnal
e591c4f638 Save product id when scheduling an automatic email
[MAILPOET-2335] [MAILPOET-2334]
2020-10-22 11:54:41 +02:00
Rostislav Wolny
54727ad9a2 Fix integration tests to work with updated codeception/verify
[MAILPOET-3203]
2020-10-20 13:18:43 +02:00
wxa
37ffcbc856 Add integration tests [MAILPOET-2979] 2020-10-07 11:48:50 +02:00
Pavel Dohnal
b1cd785dfe Fix flakey scheduler test
[MAILPOET-2896]
2020-06-11 13:24:42 +02:00
Jan Jakeš
c7de47b822 Fix class/interface/trait opening brace on the same line
[MAILPOET-2715]
2020-02-19 19:12:53 +00:00
Jan Jakeš
b39dac75d6 Autofix number of newlines between methods
[MAILPOET-2715]
2020-02-19 19:12:53 +00:00
Jan Jakeš
835d8bc0af Fix PHPUnit 6 & Codeception\Verify incompatibilities
[MAILPOET-2582]
2020-01-28 20:18:39 +00:00
Jan Jakeš
2ec85eee7b Fix mock naming and strings in integration tests
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00
Jan Jakeš
8c848cfa28 Convert property names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00
Jan Jakeš
54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00
wxa
176aba69fe Specify types for mocks [MAILPOET-2488] 2019-12-30 14:51:22 +01:00
wxa
7285a4a075 Fix extra arguments in method calls [MAILPOET-2488] 2019-12-30 14:51:22 +01:00
Amine Ben hammou
43df66d162 Add public keyword to methods
[MAILPOET-2413]
2019-12-26 18:09:45 +03:00
Rostislav Wolny
d3ce76f88d Use instance of checks for detecting WCProduct
[MAILPOET-2586]
2019-12-19 18:08:26 +00:00
Jan Jakeš
0e964de6d4 Move nesbot/carbon to vendor-prefixed
[MAILPOET-2560]
2019-12-15 21:55:48 +00:00
Jan Jakeš
60889c53f4 Add Idiorm to MailPoetVendor namespace
[MAILPOET-2545]
2019-11-27 12:38:20 +00:00
Jan Jakeš
e051870eb5 Move 'getCustomerOrderCount' from Helper to where it's used, remove Helper
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00
Jan Jakeš
25d9ffa656 Move getWooCommerceSegmentSubscriber() from helper to model
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00
Jan Jakeš
dd45a96b94 Remove unused imports
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00
Jan Jakeš
55af6fab1a Move tests to feature namespaces
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00
Jan Jakeš
f0fa9bee2e Fix WooCommerce test stubs to follow Code Sniffer rules
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00
Jan Jakeš
8fd5f987a9 Remove Premium namespace from automatic emails
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00
Jan Jakeš
5ceb4a9343 Move automatic emails from Premium plugin
[MAILPOET-2382]
2019-10-08 14:22:55 +01:00