Commit Graph

20806 Commits

Author SHA1 Message Date
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
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
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
vedanshujain 1bc2ea8754 Also include empty string and comment types for backward compat. 2020-12-18 18:08:33 +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
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
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
Peter Fabian 60e8082398 Isle of Man will probably also stop being part of EU VAT area. 2020-12-10 09:59:26 +01:00
Peter Fabian 135294dfdd Removed GB from EU VAT zone. 2020-12-10 09:46:24 +01:00
Gary Cao e6a7f0f40a
Fix Unknown named parameter error on PHP 8 2020-12-10 15:21:34 +09:00
Néstor Soriano 15315d2468
Merge pull request #28499 from woocommerce/fix/26494
Remove deprecated PayPal Standard "Page style" setting
2020-12-09 12:32:37 +01:00
Roy Ho 7f4ad80cbd
Merge pull request #28204 from jlavoie13/add/pass-email-object-to-template-parts
Pass email object to header and footer templates
2020-12-08 15:02:37 -08:00
Roy Ho 593cd0ea5d
Merge pull request #27675 from woocommerce/fix/update-premium-support-link-href
Update href of premium support link
2020-12-08 13:46:44 -08:00
Roy Ho 018dbc251d
Merge pull request #28386 from abhishek-pokhriyal/remove/bc-check-determine-locale
Remove function_exists check for determine_locale
2020-12-08 13:15:22 -08:00
jlavoie13 27f9f1304c phpcs fixes 2020-12-08 14:32:28 -05:00
jlavoie13 8821bf41c5 pass email object to header and footer templates 2020-12-08 14:32:28 -05:00
Claudio Sanches 1c65696535
Merge pull request #27850 from matt-h/webhook-schedule-when-processing
Make next webhook not return a date when the webhook is already running.
2020-12-07 19:20:02 -03:00
Claudio Sanches 09d98a6fe0
Merge pull request #28468 from woocommerce/fix/28417
Use single quotes inside MySQL query to avoid issues with ANSI_QUOTES
2020-12-07 19:08:38 -03:00
Roy Ho aa89afcf95
Merge pull request #28332 from woocommerce/update/replace-jquery-click
Replace usages of depracted jQuery.fn.click() event shorthand
2020-12-07 06:03:56 -08:00
Rodrigo Primo 23af5478ec Fix JS coding standards 2020-12-05 11:11:56 -03:00
Roy Ho 231ab353dd
Merge pull request #28469 from tyrann0us/patch-1
Simplify `reload_checkout` expression
2020-12-04 12:41:18 -08:00
Rodrigo Primo f854daea67 Remove deprecated PayPal Standard parameter
This commit removes the setting "Page style" from WooCommerce -> Settings -> Payments -> PayPal Standard. This setting was used to define the value of the parameter "page_style" passed to the PayPal Standard API, but PayPal deprecated this parameter and ignores it. According to PayPal in https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/?mark=page_style#deprecated-variables: "Deprecated variables are ignored when you pass them to PayPal". In the same link, you can see that "page_style" is included in the list of deprecated parameters.
2020-12-04 14:39:03 -03:00
Christopher Allford 57e0de341e
Merge branch 'master' into fix/27711 2020-12-03 12:11:29 -08:00
Christopher Allford 6780e3e07d Added appropriate postcode formatting for Puerto Rico 2020-12-03 11:57:30 -08:00
Rodrigo Primo 39b0d83b4d
Merge pull request #28358 from szepeviktor/patch-1
Fix types in WC_Payment_Gateway
2020-12-03 15:51:50 -03:00
Rodrigo Primo 076d0b7373
Merge pull request #28415 from zzap/patch-3
Make City and Postcode mandatory fields for Serbia
2020-12-02 11:42:24 -03:00
Néstor Soriano af3077bca9
Merge pull request #28467 from woocommerce/fix/28428
Update `lostpassword_post` action and add missing parameter
2020-12-02 15:31:21 +01:00
Néstor Soriano 43f735d0f8
Merge pull request #27558 from PlexusLLC/add_before_set_stock_action 2020-12-02 15:21:05 +01:00
Philipp Bammes c84f4600e3
Simplify `reload_checkout` expression 2020-12-02 15:01:07 +01:00