Skip to main content
These filters allow you to customize how error messages are displayed to customers throughout SureCart.

Error Message Filters

surecart/translated_error

Filter individual translated error messages. The $response object contains the error details including code, attribute, type, and options.
Filter Parameters

surecart/translated_errors

Filter the WP_Error object containing all translated error messages.

Common Error Codes

Here are some frequently customized error codes:
To find error codes for specific scenarios, open your browser’s Developer Tools (F12), go to the Network tab, and trigger the error on your checkout. Look at the XHR/Fetch request response—the code field in the JSON response is what you’ll use in your filter.

Use Cases

Custom Promotion Code Messages

Custom Stock Error Messages

Log Errors for Debugging

Custom Shipping Address Errors

Checkout

Customize the checkout process and validation.

Requests

Modify API requests and responses.