Refactor logic for passing no_shipping, it should only be passed when no shipping items are available.

This commit is contained in:
Gerhard 2019-05-21 08:11:36 +02:00
parent 8332bed7bc
commit 70231461b2
1 changed files with 1 additions and 1 deletions

View File

@ -249,7 +249,7 @@ class WC_Gateway_Paypal_Request {
*/
protected function get_shipping_args( $order ) {
$shipping_args = array();
if ( $order->has_shipping_method() ) {
if ( $order->needs_shipping_address() ) {
$shipping_args['address_override'] = $this->gateway->get_option( 'address_override' ) === 'yes' ? 1 : 0;
$shipping_args['no_shipping'] = 0;
if ( 'yes' === $this->gateway->get_option( 'send_shipping' ) ) {