Created
June 12, 2016 20:19
-
-
Save jakewhiteley/309192841d72487843065baed7454ed4 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_filter( 'woocommerce_checkout_get_value', 'get_persistent_checkout', 10, 2 ); | |
function get_persistent_checkout ( $value, $index ) | |
{ | |
$data = WC()->session->get('form_data'); | |
if ( ! $data || empty($data[$index]) ) | |
return $value; | |
return is_bool($data[$index]) ? (int) $data[$index] : $data[$index]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment