Created
October 15, 2017 09:54
-
-
Save dr5hn/e1fac26329d85946037e5a727ee23d6a to your computer and use it in GitHub Desktop.
Always Save Card on Checkout - Stripe Plugin - Woocommerce
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
<?php | |
/** | |
* Auto check Save to Account -- By Darshan Gada | |
*/ | |
// Hook in | |
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
// Our hooked in function - $fields is passed via the filter! | |
function custom_override_checkout_fields( $fields ) { | |
$fields['billing']['wc-stripe-new-payment-method'] = array( | |
'type' => 'text', | |
'label' => '', | |
'label_class' => array('hidden'), | |
'required' => true, | |
'class' => array('hidden'), | |
'default' => '1', | |
'clear' => true | |
); | |
return $fields; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
don't work