Skip to content

Commit

Permalink
Send shipping_address when default shipping_address is the billing_ad…
Browse files Browse the repository at this point in the history
…dress
  • Loading branch information
baka-san committed Jan 17, 2024
1 parent 1b26fcf commit 35b1ff5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions class-wc-gateway-komoju.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ public function create_session_for_order($order_id, $payment_type = null)
}

$shipping_address = null;
$ship_to_billing = get_option('woocommerce_ship_to_destination') === 'billing';

if ($order->has_shipping_address()) {
$shipping_address = [
'zipcode' => $order->get_shipping_postcode(),
Expand All @@ -182,6 +184,8 @@ public function create_session_for_order($order_id, $payment_type = null)
'state' => $order->get_shipping_state(),
'city' => $order->get_shipping_city(),
];
} elseif($ship_to_billing) {
$shipping_address = $billing_address;
}

// new session
Expand Down

0 comments on commit 35b1ff5

Please sign in to comment.