1. Documentation /
  2. Available Filters For WooCommerce Opayo Payment Suite

Available Filters For WooCommerce Opayo Payment Suite

Configure the credit card fields for Opayo 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 Opayo gateway, this documentation or for feature requests, email support@chromeorange.co.uk