Commit Graph

20937 Commits

Author SHA1 Message Date
roykho 218c799811
Prevent duplicate new order email from being sent when changing order status closes #27791 2021-01-13 14:13:57 -08:00
Roy Ho 0d2f478eab
Merge pull request #28690 from kevinruscoe/fix/28652
Ensure the orders status is reverted correctly when restoring it.
2021-01-13 13:54:26 -08:00
Kevin Ruscoe a78c1ec99e wp_untrash_post_status should be static as pointed out by roykho 2021-01-13 21:22:30 +00:00
Claudio Sanches 1f321f4a79
Merge pull request #28719 from raicem/update/featured-products-endpoint
Add Auth token for search/featured extensions requests
2021-01-13 18:13:25 -03:00
raicem eb3ba820da Use "wp_safe_remote_get" for sending search requests 2021-01-13 23:53:53 +03:00
Claudio Sanches 889e83e64c
Merge pull request #28698 from woocommerce/fix/28697
Add transient and action for proxying WC plugin activation hook
2021-01-13 16:49:51 -03:00
roykho 8e7a59d959
Change location of the notice so it shows up in all reports 2021-01-13 07:00:37 -08:00
Ilyas Foo 0e5596d1fc Transient and action passes plugin filename 2021-01-13 09:52:17 +08:00
Steve Grunwell 8d3803452d Refactor the WC_Shipping_Zone_Data_Store::read() method
This commit re-works the `WC_Shipping_Zone_Data_Store::read()` method in the following ways:

1. Remove a confusing conditional (`if ( 0 !== $zone->get_id() || '0' !== $zone->get_id() ) { ... }`)
2. Return early if we're dealing with Zone 0, eliminating additional conditional steps
3. Add documentation for the "woocommerce_shipping_zone_loaded" action hook
2021-01-12 12:53:22 -05:00
roykho 6041c10ea3
Add notice to deprecate old reports closes #27789 2021-01-12 07:37:00 -08:00
Nestor Soriano 10eb9f832e Remove one of the duplicate handlers for 'adjust_download_permissions' 2021-01-12 10:15:53 +01:00
Roy Ho d8b0a8558e
Merge pull request #28586 from idofri/phpdoc
Corrected data-types in phpdoc @param
2021-01-11 06:52:11 -08:00
Menaka S 950bfcdf39 Deprecate public function and remove private functions 2021-01-11 18:38:17 +05:30
Ido F 4be88bea4b corrected token-id data-type 2021-01-10 16:40:24 +02:00
Menaka S 415e1e7bbf Use site's posts_per_page size 2021-01-10 15:21:06 +05:30
Menaka S 003f4a0acb Paginate while getting orders to calculate tracker data 2021-01-10 15:17:21 +05:30
Kevin Ruscoe 91ea67d94c Clean array to make the list a little easier to understand 2021-01-09 15:11:25 +00:00
Kevin Ruscoe 0f7de7e7bf Add 'product_variation' to the list of restored post types 2021-01-09 15:08:51 +00:00
Kevin Ruscoe dd934afc2e Add product to the list of post types that should revert their status upon being restored. 2021-01-09 14:49:29 +00:00
Roy Ho 9ebf70bf8d
Merge pull request #28646 from tivnet/patch-7
abstract_wc_order:add_product() - removed `throws`
2021-01-08 10:24:37 -08:00
Roy Ho d4849c598c
Merge pull request #28692 from woocommerce/fix/28582
Add protective check to make sure WC()->session is initialized before  loading the data store.
2021-01-08 07:55:35 -08:00
Menaka S baace44f19 Remove the functio to get orders count by payment method 2021-01-08 19:45:46 +05:30
raicem f0166fcc56 Fix indentation errors as per WordPress code style guides 2021-01-07 15:14:38 +03:00
vedanshujain f8bcf6271d Revert order and product controllers to use WP Post queries directly.
This commit revert some of the changes added in #27735 because wc_get_products and wc_get_orders is not fully compitable with API controller queries. Since we are close to release 4.9, its better to revert and fix them properly then rush a fix. This undones some the performance improvements we acheived in 27735, in favor of more stability, hopefully we will be able to restore this soon.
2021-01-07 16:47:54 +05:30
Rodrigo Primo 007f3ec8aa
Merge pull request #28706 from paulochang/patch-1
Remove post code from Guatemala
2021-01-06 17:58:23 -03:00
Ron Rennick 6d402c96c8
Merge pull request #28017 from woocommerce/fix/25643
Fix E2E variable product test
2021-01-06 14:39:19 -04:00
budzanowski 1cf09eb063 Simplify. 2021-01-06 15:30:13 +01:00
budzanowski d5babd800a Review refactor. 2021-01-06 15:28:51 +01:00
Bartosz Budzanowski ca3cd5fd7e
Update includes/blocks/class-wc-blocks-utils.php
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2021-01-06 15:25:15 +01:00
vedanshujain 27b22d3aaa Move the logic to set stock_status from V2 to V3. 2021-01-06 17:55:56 +05:30
budzanowski 0b4eb9aa36 Ups. 2021-01-06 11:35:27 +01:00
budzanowski 29837c42ff Refactor. 2021-01-06 11:33:28 +01:00
vedanshujain 2ae6c5b543 Also fetch dependencies for fields which are computed from other fields. 2021-01-06 15:09:50 +05:30
vedanshujain 0d43aecebd Also fetch in_stock when stock_status requested in V2.
When called from V3, controller calls V2s get_product_data method, where stock_status was did not existed and was renamed. In V3 controller, we compute it based on V2 in_stock field.
2021-01-06 14:14:59 +05:30
budzanowski 325f72afe1 Merge branch 'master' into fix/woocommerce-gutenberg-products-block-issues-3565 2021-01-06 09:01:17 +01:00
roykho fac6d3a246
Remove do_update_woocommerce query arg to prevent actions taken on it 2021-01-05 14:16:46 -08:00
Roy Ho c6f6d04c2e
Merge pull request #28558 from tyrann0us/patch-2
Invert “if” statement to reduce nesting
2021-01-05 12:02:01 -08:00
jonathansadowski 1e267980e8
Merge pull request #28723 from woocommerce/feature/issue-27208
Feature/issue 27208
2021-01-05 14:00:55 -06:00
roykho b25f01d2f3
Add unit tests 2021-01-05 08:14:39 -08:00
Nestor Soriano 1d0b6b7cd9 Fix wc_ascii_uasort_comparison for PHP 8
In PHP 8 "iconv( 'UTF-8', 'ASCII//TRANSLIT')" doesn't work as expected:
instead of returning a proper substitute for non-ASCII characters
it returns "?". Temporarily changing the locale to C.UTF-8
fixes the issue.
2021-01-05 15:54:49 +01:00
raicem 7b67977a31 Reduce "wc_addons_featured" transient cache duration
The featured extension list was static but now it's fetched from
WooCommerce.com and may change more frequently. Reducing the
cache duration to allow users to see changes much more quickly.
2021-01-05 17:45:34 +03:00
raicem c70eee2a0a Send auth token when sending search and featured extension requests 2021-01-05 17:40:58 +03:00
Ron Rennick eca159ecab phpcs fixes, on sale dates should be displayed in local time 2021-01-05 13:19:49 +01:00
Ron Rennick 0d2a5ac5e9 Fixes needed for variable product E2E test
- Jest/Puppeteer sometimes will not find an element on page load when that element is outside the initial viewport
- There were duplicate .variation_tab classes which confused Jest/Puppeteer
- Add function for opening and verifying new product page
- Update test sequence for changes in flow in markup and Jest/Puppeteer
2021-01-05 13:19:49 +01:00
Vedanshu Jain 7d4cf1b8bf
Merge pull request #28677 from woocommerce/fix/request-request-arg-api
Add protection around `func_get_arg` method for backward compatibility.
2021-01-05 17:45:31 +05:30
vedanshujain 3a7e3fda34 Use `!empty` for consistency with other usages. 2021-01-05 16:37:39 +05:30
raicem c628c15ac6 Update featured products endpoint
WooCommerce.com will provide this list of products.
2021-01-05 12:43:17 +03:00
vedanshujain 80f5d35311 Apply coding standards w.r.t PR #28677 2021-01-05 13:47:16 +05:30
roykho 7b091485a2
Create product tags if they don't exists closes #27208 2021-01-04 14:59:28 -08:00
Ron Rennick 82fb9f106d
Merge pull request #27137 from woocommerce/issue_26959
Modify the logic for deleting variations
2021-01-04 13:06:24 -04:00
Paulo Chang 41f853fbc1
Remove post code from Guatemala
Guatemala has no real working postal service. We therefore don't use postal codes. Address and department is enough.
2020-12-31 22:41:51 +01:00
Ilyas Foo 0e590d1bdb Add transient and action for proxying WC plugin activation hook 2020-12-31 14:30:29 +08:00
Fernando Marichal 543f1e1307 Fixed copy 2020-12-30 12:13:39 -03:00
vedanshujain f945f9a015 Add protective check to make sure WC()->session is initialized before loading the data store. 2020-12-30 19:20:51 +05:30
Fernando Marichal f2648d76cf Turned merchant email notifications on by default
This commit adds the code to turn email notifications on by default
2020-12-30 10:42:53 -03:00
Kevin Ruscoe 64c4805109 Ensure the orders status is reverted correctly when restoring it. 2020-12-30 13:25:40 +00:00
Fernando Marichal 5a21a4f71c Added merchant email note configuration
This commit adds a merchant email note configuration option
2020-12-29 14:31:46 -03:00
budzanowski 32c1c9c963 Print missing block info in the status page. 2020-12-28 16:27:31 +01:00
budzanowski c81df313b2 Add block information for woocommerce pages report. 2020-12-28 16:19:51 +01:00
vedanshujain 818e24d5c5 Add protection around `func_get_arg` method for backward compatibility.
We are using func_get_arg method to receive argument in a backward compatible way since we cannot modify function signature to add more params even with default params. Earlier I was hoping to use DI to create another child class with modified signature and load it depending upon where we are executing from, however since we had to revert DI, we add this workaround to unblock #27735.
2020-12-28 14:10:22 +05:30
Menaka S 88dd6473d4 Some fixes for coding standards 2020-12-23 17:05:17 +05:30
Menaka S 092c36b71b Get order total values 2020-12-23 17:05:10 +05:30
Menaka S e9804ea717 Add order counts by gateway 2020-12-23 17:05:03 +05:30
Menaka S 1a6835019a Add order counts by status 2020-12-23 17:04:54 +05:30
Menaka S 0aee0a0848 Use wc_get_orders() to add order dates for tracker 2020-12-23 17:04:32 +05:30
Menaka S 8d83b47c27 Check if post_type is shop_order 2020-12-23 17:04:14 +05:30
Menaka S 36d6ff4c52 Add a function to get order counts by payment method 2020-12-23 17:04:02 +05:30
Vedanshu Jain f46af1160f
Merge pull request #28537 from garyc40/fix/update-callback-named-parameter
[PHP 8] Fix Unknown named parameter error when running database update routines
2020-12-23 14:28:54 +05:30
Claudio Sanches ba37b7332a
Merge pull request #28650 from woocommerce/prep/master
Prep master for 5.0.0
2020-12-22 20:30:26 -03:00
Ron Rennick 33eb98c80c
Merge pull request #28612 from woocommerce/fix/26092
Price calculation: fix documented return types
2020-12-22 14:43:47 -04:00
vedanshujain 44705386a4 Prep master for 5.0.0. 2020-12-22 19:01:56 +05:30
Vedanshu Jain 800c6a61b7
Merge pull request #28620 from woocommerce/fix/28505
Stock management regression fixes
2020-12-21 22:36:53 +05:30
Gregory Karpinsky 6cb569047a
abstract_wc_order:add_product() - removed `throws`
Exception 'WC_Data_Exception' is never thrown in the function
2020-12-21 11:26:50 -05:00
Claudio Sanches 8cc953950e
Merge pull request #28624 from woocommerce/fix/27688
Also include empty string and comment types for backward compat.
2020-12-21 12:11:09 -03:00
vedanshujain b4b03f3b46 Merge branch 'master' into fix/28505 2020-12-21 15:42:04 +05:30
vedanshujain f248276a89 Use correct syntax for translators comments. 2020-12-21 15:33:10 +05:30
vedanshujain 39c200bf2d Merge branch 'master' into fix/27673 2020-12-21 15:29:55 +05:30
Omkar Bhagat 00831c707c Revert functon's @since version num back to 3.0 2020-12-21 09:48:34 +05:30
vedanshujain 1bc2ea8754 Also include empty string and comment types for backward compat. 2020-12-18 18:08:33 +05:30
Omkar Bhagat 34563c22bb Inline doc for the new filter
Updated @since to 4.9 and added an inline doc for the new filter
'woocommerce_delete_variations_on_product_type_change'
2020-12-18 17:04:27 +05:30
vedanshujain 934b10fb8c Use wc_get_orders for consistency intead of custom query 2020-12-18 14:40:20 +05:30
vedanshujain 089994c618 Dont fetch optional fields unless asked to improve performance 2020-12-18 14:40:20 +05:30
vedanshujain 04f948951a Fetch product attrs only when needed 2020-12-18 14:40:20 +05:30
vedanshujain 13bee82ed9 Cover missed cases 2020-12-18 14:40:20 +05:30
vedanshujain 54dd5550e5 Pass request in backward compatible way 2020-12-18 14:40:20 +05:30
vedanshujain e62169a4b5 Cache return fields for perfromance 2020-12-18 14:40:20 +05:30
vedanshujain 2e65b8cec4 Fetch expensive fields only when required for performance 2020-12-18 14:40:20 +05:30
vedanshujain 892b7caa37 Stock managment fixes:
1. Use $already_reduced_stock instead of also considering $refunded_item_quantity while deleting orders. This will bring back part of #27504 again, but for now this seems to be the best solution for countering #28605. It needs discussion whether deleting a line item completely should also undo any refund related changes on it or not.

2. Also mark `stock_reduced` flag on order if any of the line item has any `_reduced_stock` flag. This will allow for stock restoring logic to work properly when order is cancelled.

3. Only adjust line item stock when order is in `processing`, `completed` or `on-hold` status state, because we need to reduce stocks on these status only. Stock adjustments in refunds or when changing statuses is already taken care of by their specific hooks.
2020-12-17 22:28:21 +05:30
Leif Singer bc3e6a8532 Price calculation: fix documented return types
Fixes #26092.
2020-12-17 15:35:07 +01:00
Claudio Sanches 6c132c1e25
Merge pull request #28543 from woocommerce/fix/27521
Fix issue where customer could checkout although mandatory field "Country" was not given
2020-12-16 17:01:10 -03:00
Claudio Sanches d523f5aad2
Merge pull request #28538 from woocommerce/fix/remove-gb-from-eu-vat
Remove GB and IM from EU VAT countries
2020-12-16 16:59:02 -03:00
vedanshujain 6fa77b3d8e Fixup for myaccount page logic, it should be > 0 ot be considered as set. 2020-12-16 19:48:09 +05:30
vedanshujain 6b550ffb23 Better error messages for when coupon are held in other transactions.
Earlier, we were just showing an "Usage limit reached message", however in some cases, specially when user is logged in, we can also ask them to go to MyAccount page and cancel order if they'd like to (to free up the coupon). This will hopefully make for a better user experience.
2020-12-16 15:19:40 +05:30
vedanshujain 507e7a27b2 Better error messages when coupons are stuck in a pending order.
We hold coupons when payment is failed if the setting "hold stock for checkout" is enabled for some minutes. This is to allow the customers to try again if they want, and to give time to complete payment for gateways where it could take some time.

Unfortunately this cause for some bad UX user retries by starting the order from scratch again, and then if they apply the coupon, usage limit gets hit because the earlier coupon is still held and is counted towards the usage. This commit improves the error message in these cases when usage is applied per customer and is hit, by stating to go to my account to complete/cancel payment (in case of logged in user) or to wait for some time in case of guest users.
2020-12-15 16:01:14 +05:30
Ido F 703d474e52 corrected data-types in phpdoc @param 2020-12-14 13:31:52 +02:00
Vedanshu Jain 4339aee35f
Merge pull request #27352 from juliquiron/fix/slow-wc-customer-get-operations
Added cache and filter for wc-customer get operations.
2020-12-14 09:43:04 +05:30
Philipp Bammes 19d978ce1c
Invert “if” statement to reduce nesting 2020-12-11 08:23:22 +01:00
Nestor Soriano f0b834d1ec Move the download permissions adjustment process to a scheduled action.
Also, move all the new code from the 'WC_Product_Data_Store_CPT' class
to a new separate 'DownloadPermissionsAdjuster' class.
2020-12-10 15:40:38 +01:00
Rodrigo Primo 93dae948b2 Add placeholder text to country select field in the checkout page
This commit adds the 'Select a country / region...' text as a placeholder text displayed in the country select field indicating to the user that they need to select a country. This is only needed when the option ¨Default customer location" is set to "No location by default".
2020-12-10 11:12:39 -03:00
Rodrigo Primo 5554f9c6f9 Revert "Sets Select a country option element value attribute to default."
This reverts commit 9faee1d909 as it causes issues during checkout (see #27521).
2020-12-10 10:09:02 -03:00