mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Merge branch 'drop-shipping-when-only-digital-items'
This commit is contained in:
commit
7ae4af0886
1 changed files with 7 additions and 1 deletions
|
@ -149,7 +149,13 @@ class PurchaseUnitFactory {
|
|||
|
||||
$shipping = null;
|
||||
$customer = \WC()->customer;
|
||||
if ( is_a( $customer, \WC_Customer::class ) ) {
|
||||
$needs_shipping = false;
|
||||
foreach ( $items as $item) {
|
||||
if ( $item->category() !== Item::DIGITAL_GOODS ) {
|
||||
$needs_shipping = true;
|
||||
}
|
||||
}
|
||||
if ( $needs_shipping && is_a( $customer, \WC_Customer::class ) ) {
|
||||
$shipping = $this->shipping_factory->from_wc_customer( \WC()->customer );
|
||||
if (
|
||||
! $shipping->address()->country_code()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue