mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Call calculate_shipping before validation
This commit is contained in:
parent
fddd6c35e9
commit
d6bd403b5a
1 changed files with 3 additions and 0 deletions
|
@ -35,6 +35,9 @@ class CheckoutFormValidator extends WC_Checkout {
|
||||||
// And we must call get_posted_data because it handles the shipping address.
|
// And we must call get_posted_data because it handles the shipping address.
|
||||||
$data = $this->get_posted_data();
|
$data = $this->get_posted_data();
|
||||||
|
|
||||||
|
// Looks like without this WC()->shipping->get_packages() is empty which is used by some plugins.
|
||||||
|
WC()->cart->calculate_shipping();
|
||||||
|
|
||||||
// It throws some notices when checking fields etc., also from other plugins via hooks.
|
// It throws some notices when checking fields etc., also from other plugins via hooks.
|
||||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
||||||
@$this->validate_checkout( $data, $errors );
|
@$this->validate_checkout( $data, $errors );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue