How to Create a Validation Function?⚡

Use a Validation Function to enforce rules during the cart or checkout process, ensuring data accuracy and a seamless customer experience. Follow the steps below:

Step 1: Create the Function

  • Navigate to the Nexus Dashboard and click Create Function.

  • Select Validation Functions from the list.

Step 2: Choose Validation Type

  • Click on Conditional Cart & Checkout Validation.

  • A setup screen will appear.

Step 3: Configure Basic Settings

  • Enter the Function Name.

  • Select the Function Input Type.

  • Choose conditions based on your specific requirements (e.g., customer tags, cart total, shipping method).

Step 4: Add a Validation Error

  • Click on Add Validation Error to begin setting up your validation rule.

  • A popup will appear.

Step 5: Define the Validation Details

  • Select the User Journey: Choose the page where the error should appear (e.g., Cart or Checkout).

  • Select the Target: Define the specific field or section (e.g., Email, Phone, Address).

  • Enter the Error Message: This is the message customers will see when validation fails.

  • You can add multiple validation errors if needed.

Step 6: Configure Validation Settings

To ensure your function works correctly and is enforced during checkout:

  • Scroll down to the Validation Settings section.

  • Check the box labeled Active to enable the validation function.

  • Check Block on failure if you want the checkout to stop when the conditions of your function are not met (e.g., if the required bundle items aren't in the cart).

  • Once everything is set, click Save to create your validation function.

🎉 You're all set! Enjoy a smarter, smoother checkout experience with Nexus Function. 😊

To explore examples and better understand how different functions work, visit our FAQs section — it’s packed with helpful guides, use cases, and setup examples.

Last updated