Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jakewhiteley/309192841d72487843065baed7454ed4 to your computer and use it in GitHub Desktop.
Save jakewhiteley/309192841d72487843065baed7454ed4 to your computer and use it in GitHub Desktop.
<?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