mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
reset shipping if incomplete
This commit is contained in:
parent
8a16329c29
commit
47b9fc8894
1 changed files with 6 additions and 0 deletions
|
@ -105,6 +105,9 @@ class PurchaseUnitFactory
|
|||
$breakdown
|
||||
);
|
||||
$shipping = $this->shippingFactory->fromWcOrder($order);
|
||||
if ($shipping->address()->countryCode() && !$shipping->address()->postalCode()) {
|
||||
$shipping = null;
|
||||
}
|
||||
|
||||
$referenceId = 'default';
|
||||
$description = '';
|
||||
|
@ -200,6 +203,9 @@ class PurchaseUnitFactory
|
|||
$shipping = null;
|
||||
if (is_a(\WC()->customer, \WC_Customer::class)) {
|
||||
$shipping = $this->shippingFactory->fromWcCustomer(\WC()->customer);
|
||||
if ($shipping->address()->countryCode() && !$shipping->address()->postalCode()) {
|
||||
$shipping = null;
|
||||
}
|
||||
}
|
||||
|
||||
$referenceId = 'default';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue