Created
June 12, 2016 20:20
-
-
Save jakewhiteley/bfd81fde108246aed8cbc4460458b6ac to your computer and use it in GitHub Desktop.
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
<?php | |
add_action( 'woocommerce_ship_to_different_address_checked', 'get_persitent_ship_to_different' ); | |
function get_persitent_ship_to_different ( $value ) | |
{ | |
$data = WC()->session->get('form_data'); | |
if ( ! $data || empty($data['ship_to_different_address']) ) | |
return $value; | |
return is_bool($data['ship_to_different_address']) ? (int) $data['ship_to_different_address'] : $data['ship_to_different_address']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment