Skip to main content

Customize Stitch checkout

Choose the lightest approach that fits your goal.

GoalApproach
Restyle the formCSS on #wc-stitch-form, .stitch-payment-header, etc.
Change labels or copyAdmin settings or stitch_payments_checkout_field_labels / stitch_payments_payment_form_i18n
Change logo or brandingAdmin settings or stitch_payments_checkout_display_settings
Inject HTML (classic)Action hooks in the payment template
Replace classic markupTheme template override
Change Blocks datastitch_payments_blocks_payment_method_data
Style card-number iframestitch_payments_iframe_css
Customize decline messagesstitch_payments_customer_decline_message
Custom checkout pagestitch_payments_is_checkout_context

Classic template override​

Copy the plugin template to your theme:

wp-content/themes/your-theme/woocommerce/stitch/payment-form.php

Template variables​

VariableDescription
$gatewayGateway instance
$enable_profilesSaved payment methods enabled
$checkout_displayBranding options
$field_labelsField label strings
$i18nPayment form strings
$saved_methodsSaved cards keyed by account ID
$default_acct_idPre-selected saved card

Filter template args with stitch_payments_payment_form_template_args.

Example: filter template args​

add_filter( 'stitch_payments_payment_form_template_args', function ( $args, $gateway ) {
$args['i18n']['save_card'] = 'Store this card securely';
return $args;
}, 10, 2 );

Blocks checkout​

Blocks checkout does not use the PHP template. Use:

  • stitch_payments_blocks_payment_method_data for script data
  • stitch_payments_payment_form_i18n for shared strings

Companion plugin bootstrap​

<?php
/**
* Plugin Name: My Stitch Checkout Tweaks
*/

add_action( 'stitch_payments_loaded', function () {
add_filter( 'stitch_payments_payment_form_i18n', function ( $strings, $gateway ) {
$strings['save_card'] = 'Securely store this card';
return $strings;
}, 10, 2 );

add_action( 'stitch_payments_before_payment_form', function ( $gateway, $saved_methods ) {
echo '<p class="my-stitch-notice">We accept Visa and Mastercard.</p>';
}, 10, 2 );
} );

Payment header HTML​

If you filter stitch_payments_payment_header_html, return markup you trust. Output is sanitized with Card_Icons::kses_payment_header_html() so inline SVG card icons are preserved (unlike wp_kses_post()).

See the full Hooks reference.