Actions
Actions are triggered during the checkout process and when orders are confirmed. This is at the end, after payment is successuflly confirmed by the processor.surecart/checkout_confirmed
Fired after an order is confirmed and all purchases have been processed. Use this for post-checkout operations like analytics tracking, external notifications, or custom logging.
Filters
Form Validation
These filters run during the finalize step of checkout, before the order is submitted. Use them to validate form data and prevent checkout if validation fails.surecart/checkout/validate
Add custom server-side validation to checkout forms. This filter runs during the finalize step, after client-side validation passes but before the order is submitted to the payment processor.
Validate Email Domain
Block specific email domains from purchasing:Validate Custom Fields
Validate custom form fields added to your checkout:Validate Based on Form ID
Apply validation only to specific checkout forms:User Creation
surecart/checkout/auto-login-new-user
Control whether newly created users are automatically logged in after checkout.
Display
surecart_checkout_show_converted_total
Control whether converted currency totals are shown when using currency conversion.
sc_checkout_price_selector_first_price_as_default
Control whether the first price is selected by default in price selectors.
Payment Mode
surecart/payments/mode
Filter the payment mode (live/test). Useful for testing or staging environments.
JavaScript Filters
SureCart provides JavaScript filters using the WordPress hooks system (wp.hooks) to customize the Stripe Payment Element. These filters allow you to modify payment method order, wallet visibility, legal terms display, and billing fields.
These filters use the
@wordpress/hooks
package, which is automatically available on pages with SureCart checkout.
Payment Method Order
Usesurecart_stripe_payment_element_payment_method_order to reorder the payment methods displayed in Stripe’s Payment Element.
Wallet Visibility
Usesurecart_stripe_payment_element_wallets to control the visibility of digital wallets like Apple Pay, Google Pay, and Link within the Payment Element.
Legal Terms Display
Usesurecart_stripe_payment_element_terms to manage the display of mandates and other legal agreements within the Payment Element. By default, these are shown only when necessary.
Billing Fields
Usesurecart_stripe_payment_element_fields to control which billing address fields are displayed within the Stripe Payment Element. This is useful when you’re already collecting billing information elsewhere in your checkout form.
'auto'. For example, to hide all fields except country:
Address Countries
Usesurecart_address_countries to customize the list of countries available in address fields. You can add, remove, reorder, or translate country names.
To add custom JavaScript filters to your site, you can use plugins like
Simple Custom CSS and JS. Be
sure to load scripts in the footer for checkout page compatibility.
value (ISO country code) and label (display name) properties.
Address Regions
Usesurecart_address_regions to customize the regions (states, provinces, etc.) available for specific countries. You can add, remove, or translate region names.
regions array and the country code. Each region object must include both value and label properties.
Use Cases
Analytics & Conversion Tracking
Send to Slack
Validate Minimum Order Amount
Restrict Purchases by Country
Require Terms Acceptance
Validate Tax Identifier
Use the built-intax_identifier field to validate VAT/tax ID numbers: