How to show an error message at checkout to customers who have returned cash-on-delivery (COD) orders
Open F: Function-Creator
- Click the “Create Function” button
- Choose “Validation functions”
- Choose “Conditional cart & checkout validations”

- Give the rule a name
- In “When do you want this rule to work?”, change “Always” to “When certain conditions are met”
- In “Qualifier behaviour”, choose “All qualify” or “Any qualify”

- Click on “Add condition”
- Choose **“Customer tag” **from

- Enter the customer tag
- I’m using the tag i applied to customers who returned
- Enter the amount and click “Add”
- If you want, you can add more than one condition

- Click on “Add validation error” to choose where the error should appear and what message to show
- Choose “Target Placement” from the list

- Choose “Top of the checkout”
- Enter the error message you want to show

- Block on failure: if enabled, checkout is blocked when the transform fails
- Click on “Create”

That's it! You've successfully created a checkout validation function for your Shopify store
Updated on: 26/11/2025
Thank you!