1. Documentation
  2. Plugins
  3. WooCommerce
  4. Extensions

Available Filters For WooCommerce SagePay Form / Direct

Configure the credit card fields for SagePay Direct ↑ Back to top

You can use the filter woocommerce_sagepaydirect_credit_card_form_fields to modify the fields used on the credit card form.

You can rearrange the order of the fields with this code in your theme functions.php file

add_filter( 'woocommerce_sagepaydirect_credit_card_form_fields', 'custom_woocommerce_sagepaydirect_credit_card_form_fields' );
function custom_woocommerce_sagepaydirect_credit_card_form_fields( $fields ) {

$new_fields = array();
$new_fields[] = $fields[‘card-number-field’];
$new_fields[] = $fields[‘card-expiry-field’];
$new_fields[] = $fields[‘card-cvc-field’];
$new_fields[] = $fields[‘card-type-field’];

return $new_fields

It is recommended that you do not change the ID or field names.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy.

Feedback and feature requests ↑ Back to top

For feedback on the SagePay gateway, this documentation or for feature requests, email support@chromeorange.co.uk

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment