Created
March 25, 2012 11:38
-
-
Save mikejolley/2193064 to your computer and use it in GitHub Desktop.
WooCommerce - Store customer IP in order meta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code goes in functions.php | |
add_action( 'woocommerce_checkout_update_order_meta', 'wc_store_user_ip' ); | |
function wc_store_user_ip( $order_id ) { | |
update_post_meta( $order_id, 'Customer IP', $_SERVER['REMOTE_ADDR'] ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why not include this in the core, to avoid fake customers and be able to block them?