Commit Graph

345 Commits

Author SHA1 Message Date
Alfredo Sumaran 8fa6265ef7 Fix Code Sniffer error 2021-05-17 18:35:18 -05:00
Alfredo Sumaran f20e8ab567 Move variable declaration outside foreach loop 2021-05-17 18:27:17 -05:00
Alfredo Sumaran 79db2d95a0 Use default value only if form was displayed to the user
Also changed variable name for readability
2021-05-17 17:15:16 -05:00
Alfredo Sumaran 32566c508e Consolidate value for checkbox input types 2021-05-17 16:27:47 -05:00
Alfredo Sumaran c7bd680579 Consolidate value for checkbox input types 2021-05-17 16:27:47 -05:00
Alfredo Sumaran 195acd0866 Skip switch statement if value is empty 2021-05-17 16:27:47 -05:00
Alfredo Sumaran 5a5a808182 Update syntax to ignore line from PHP CodeSniffer 2021-05-17 16:27:47 -05:00
Alfredo Sumaran 90443914f0 Set checkout field value with defined default 2021-05-17 16:27:47 -05:00
Nestor Soriano a37b2a7474
Don't verify empty country codes on checkout
PR #28849 introduced a verification of the posted country code
on checkout, so an invalid code will throw an error. However there
are cases when an empty code is legitimately received, for example
when using Paypal checkout directly from the product page and
the customer doesn't have an address in his Paypal profile.
2021-04-07 09:59:56 +02:00
Nestor Soriano 0cdb1f74c1 Revert replacing wp_redirect with wp_safe_redirect
Following a code snippet suggestion the wp_redirect in
WC_Checkout::process_order_payment was replaced with wp_safe_redirect,
but this had unitended side effects. From issue #29387:

You've changed wp_redirect to wp_safe_redirect in
WC_Checkout::process_order_payment. If a 3rd-party-plugin executes a
"non-AJAX-processing-order", wp_safe_redirect will be executed.
But your default PayPal interface will redirect to an URL that is
not allowed in wp_validate_redirect because your default PayPal Gateway
does not add the required PayPal URLs with the hook
"allowed_redirect_hosts". As a result, it could happen that a customer
is not redirected to PayPal but to wp-admin
(https://developer.wordpress.org/reference/functions/wp_safe_redirect/).
2021-03-22 16:11:11 +01:00
Krzysztof Grabania aebdf869d9 Add order_id to checkout result response 2021-03-13 10:52:08 +01:00
roykho 4fa0c81d11
Check if index value is set before accessing 2021-02-15 06:54:22 -08:00
Nestor Soriano e82ab487b6 validate_posted_data: check if we actually need to validate the shipping country. 2021-02-10 10:05:24 +01:00
Nestor Soriano 87d04b8d64 Remove no longer relevant exception doc comment 2021-02-09 10:07:43 +01:00
Nestor Soriano 26f71af0a9 Fix in the logic of 'validate_checkout' regarding non-existing countries. 2021-02-08 16:20:33 +01:00
Nestor Soriano 07f3d9dee6 Add unit tests for the WC_Checkout class. 2021-02-08 15:49:38 +01:00
Nestor Soriano 70202c35bd Move country validation to 'validate_posted_data'.
Also, when shipping to billing address don't show the error twice,
and show the "we don't ship to X" error only if the country actually
exists (if it doesn't then we'll have shown the "X is not a valid
country code" already).
2021-02-08 15:37:50 +01:00
Nestor Soriano ef9a11976c WC_Countries::country_exists no longer throws an exception. 2021-01-22 10:57:25 +01:00
Nestor Soriano aae44ac1cd Fix code sniffer errors 2021-01-19 10:56:08 +01:00
Nestor Soriano 053a45e0b2 Validate checkout countries in the backend 2021-01-19 10:28:56 +01:00
Claudio Sanches f8f1417d72 Fixed function name 2020-11-13 17:57:29 -03:00
Claudio Sanches b506627528 Keep WC_Checkout::process_checkout() backwards compatible 2020-11-13 17:49:27 -03:00
Christopher Allford e711a447fe Fixed order account creation 2020-11-04 16:56:32 -03:00
Dominic Vermeulen-Smith c054a2803b issue #24631 - Updated needs payment check to use order 2020-10-06 17:38:07 +01:00
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Ron Rennick 5ee0eccb7b add/update correct deprecated notices on existing deprecations 2020-07-16 17:13:08 -03:00
vedanshujain b8a1a69b2b Updated annotations to 4.3 2020-06-15 18:55:00 +05:30
Vedanshu Jain b45373fe0c Revert "Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout"" 2020-06-05 15:18:01 +05:30
Claudio Sanches f3dc64679d Set an error ID for each WP_Error entry 2020-05-05 15:56:16 -03:00
Vedanshu Jain ee119e0a7e
Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout" 2020-04-21 15:37:21 +05:30
Vedanshu Jain 3bf473517d
Merge pull request #25708 from woocommerce/update/reserve-stock-for-checkout
Introduce a `reserved stock` class and database table to prevent race conditions during checkout
2020-04-07 02:16:22 +05:30
Vedanshu Jain 237463c39b
Merge pull request #25800 from woocommerce/fix/25748
Fixes tax rounding issues
2020-04-07 00:24:34 +05:30
Mike Jolley f248902454 Update versions 2020-04-03 15:56:43 +01:00
Mike Jolley 910a13f544 Fire action hooks rather than call stock holding functions directly 2020-04-03 15:55:14 +01:00
Claudio Sanches 2ebd86f2dc Revert "Revert "Add support for '_held_for_checkout` records to prevent race conditions."" 2020-04-03 15:55:13 +01:00
Daniel Morell 7b7934e237
Fixed screen-reader-text label class set as string
The field 'label_class' should be an array not a string. This fix makes it an array.
2020-03-03 14:06:52 -06:00
vedanshujain f5e5eda946 Refactor `create_order` to make it more testable 2020-03-02 15:19:00 +05:30
Reüel van der Steege 97456e7d78 Add order meta `is_vat_exempt` with unique meta key. 2020-01-20 12:06:32 +01:00
vedanshujain 72545c44b7 Add support for `_held_for_checkout` records to improve performance.
This will also improve transactional stability and avoid race conditions by providing a way to lock usage counts.
2019-12-17 19:13:19 +05:30
Claudio Sanches af4ef7ea0d Pass input ID to wc_add_notice() 2019-11-07 20:25:06 -03:00
Ewout Fernhout 40a1f268f1 fix setting rate percent in checkout 2019-07-11 15:56:02 +02:00
parmarhardip 6b92769626 Fixes #23521 - Billing Email and Country now autofill for newly registered customers 2019-04-26 17:21:40 +05:30
Gerhard 134f9c9c8e Fix PHPCS 2019-04-15 12:13:02 +02:00
Ralf 66540f1b5d Moved accessibility labels for checkout after woocommerce_checkout_fields filter 2019-04-15 12:09:33 +02:00
Mike Jolley cc8e516f7a
Merge pull request #22786 from woocommerce/improve/user-registration
Improve user's display_name generation during checkout
2019-02-27 12:55:56 +00:00
Claudio Sanches 5302434057 Fill user first and last name during checkout 2019-02-20 16:29:34 -03:00
Claudio Sanches efaa723a5b Only set user first and last names when those fields are empty 2019-02-20 13:55:51 -03:00
Mike Jolley 4672a47d67 Update from master 2019-02-18 11:41:05 +00:00
Mike Jolley eed91070b1 Allow notice to persist after customer ID change 2019-02-04 15:48:59 +00:00
Mike Jolley fe2e70d7dc
Merge pull request #22392 from woocommerce/fix/checkout-shipping-address-20975
For logged in customers, pull default address fields from customer object, not session object
2019-02-04 11:23:03 +00:00