Skip to content

Instantly share code, notes, and snippets.

@LaurenaRehbein
Created January 12, 2018 00:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LaurenaRehbein/66577075b79e11c43f0ea79626d665f2 to your computer and use it in GitHub Desktop.
Save LaurenaRehbein/66577075b79e11c43f0ea79626d665f2 to your computer and use it in GitHub Desktop.
A sample of the edited function
add_filter( 'wc_stripe_payment_icons', 'change_my_icons' );
function change_my_icons( $icons ) {
// var_dump( $icons ); to show all possible icons to change.
$icons['visa'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/visa.svg" />';
$icons['mastercard'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/mastercard.svg" />';
$icons['amex'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/amex.svg" />';
return $icons;
}
@kontur
Copy link

kontur commented Mar 15, 2018

You can improve the code to make it site agnostic by changing the src tags to $icons['visa'] = '<img src="' . WP_PLUGIN_URL . '/woocommerce/assets/images/icons/credit-cards/visa.svg" />'; etc.

@LaurenaRehbein
Copy link
Author

@kontur I missed this comment - thank you, this is a great tip!

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