Merge pull request #21038 from woocommerce/fix/21002

Update customer's ip address on successful payment.
This commit is contained in:
Claudiu Lodromanean 2018-08-13 11:32:09 -07:00 committed by GitHub
commit 28f4185899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -229,6 +229,12 @@ class WC_Shortcode_Checkout {
// Empty awaiting payment session.
unset( WC()->session->order_awaiting_payment );
// In case order is created from admin, but paid by the actual customer, store the ip address of the payer.
if ( $order ) {
$order->set_customer_ip_address( WC_Geolocation::get_ip_address() );
$order->save();
}
// Empty current cart.
wc_empty_cart();