Created
December 29, 2020 05:35
-
-
Save zarankumar/4c2eeae460de73ec255b997ebb3bfa2b to your computer and use it in GitHub Desktop.
Get long/lat in checkout page woocommerce
This file contains 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
add_action('woocommerce_checkout_update_order_review','sg_get_latlong',20,2); | |
function sg_get_latlong($posted_data ){ | |
parse_str($posted_data, $output); | |
// error_log(print_r($posted_data,true)) ; | |
if(isset($output['shipping_lat'])){ | |
$customer_shipping_lat=$output['shipping_lat']; | |
$customer_shipping_long=$output['shipping_long']; | |
}else{ | |
$customer_billing_lat=$output['billing_lat']; | |
$customer_billing_long=$output['billing_long']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment