Skip to content

Instantly share code, notes, and snippets.

@dr5hn
Created October 15, 2017 09:54
Show Gist options
  • Save dr5hn/e1fac26329d85946037e5a727ee23d6a to your computer and use it in GitHub Desktop.
Save dr5hn/e1fac26329d85946037e5a727ee23d6a to your computer and use it in GitHub Desktop.
Always Save Card on Checkout - Stripe Plugin - Woocommerce
<?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;
}
?>
@SuperMario360
Copy link

don't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment