> For the complete documentation index, see [llms.txt](https://nexus-functions-creator-and-disc.gitbook.io/nexus-functions-creator-and-discounts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nexus-functions-creator-and-disc.gitbook.io/nexus-functions-creator-and-discounts/faqs/how-to-restrict-user-from-checkout.md).

# How to Restrict user from checkout?🤔

<mark style="color:$success;background-color:$success;">**Objective: Blocks checkout for customers tagged “banned” and displays a custom validation error..**</mark>

### **Step 1: Create the Function**

* Navigate to the **Nexus Dashboard** and click **Create Function.**
* Select **Validation Functions** from the list.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd3d-llosPwiEJDjDO9R7iYpObrAP3omPw9fZuvjn9_N25ifN31WBrSo6Xnwjzcen-dWj4ZXxcJ_-tfnDM7GMAnNP4RQ9IPJnVarwRR1Vo2uNhMd7d7xYqgrXeUpbjjRASp9TxgWA?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

### **Step 2: Choose Validation Type**

* Click on **Conditional Cart & Checkout Validation.**
* A **setup screen** will appear.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdKTuH3Jx1ldw6lJ8suWb4OUF35jLGVHBFBZq5RoKezQPA4sjZHtmYe95W3It11AROHMOEtGc_dVJOjoV_SHdcXQbmN6y2HsckOShQ7Hw-Bw3CglKqnrRr6vrBdBbNgvGft415BEg?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

### **Step 3: Configure Basic Settings**

* Enter the **Function Name.**
* Select the **Function Input Type** to **Advanced Input.**
* Select **Customer Tags** from **Customer Qualifier.**
* **Condition:** Does Match one of the
* **Customer Tags:** Banned

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfjezhuWuRmAl9rBRWBTRN7t3ZzC855w2fY83P4n--FGkfPO4EzSM062Fq7iN1HGWt0KfjEXTDLmip7VdlbsMr2Q6l-Onbaov8l2gMotRAOoAA1uLemYCqqI9OMbEVdI5mOJHz2?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

<mark style="color:$warning;background-color:$warning;">**Note:(Validation Message will be shown Only Banned -tagged customers …You can assign the Banned  tag to a customer by adding it directly to their profile.)**</mark>

### **Step 4: Add a Validation Error**

* Click on **Add Validation Error** to begin setting up your **validation rule.**
* A **popup** will appear.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfP2A76TLo9jVg-Wu4sPMVn2B4CO3M-y5L2I7Jq92Ok74UWSjZOr8HaQJYtjgzcvc6dxmI18UjgTC21KuwuLExfAgDGNxw_clqTsQdvuoznBkQMWwDKwZ1gPlgqI9asefQwNjG2Zw?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

### **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)
* **Enter the Error Message:** This is the **message customers** will see when **validation fails.** And **Click on Save.**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfbk5vzeIysGQo3077y372kJA5SlW6zKTjp8gg0mCE966vFP-ciXKgheFDaSaSaX1Png1Wk6OgbTUWrpkoU_PjNLDiskKK20GQGLdB1kJEN5P_tgFIRe-OWJZzb-bwpTVP-XL8f?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

### 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.**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdu2J5XYy387t02Xc9YWAeoX1AtuBfhSMz0lx3HgaIScMFsUyQGdor4xQuWGwsyanPkwR3fkWrXTjE-bx3upbP1atMSfqNGbNTazQMTFFNVRnN7s57h810sPxbpggG2V5gHDGPfbg?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXczC5MicRJMqeBs-y7yfb5yyBznlGsAP-iUJqaVkXMDPSmHqVJQog_LiEMZH33Qgz380vPKHT3Q6-lRXB9NghCiesbG2Q7mnOI4V-y4_TA35pQSZuVgYFcCCgDrQs2fyINs-igD?key=XHBNr_XRasDLQzq5MfrM2Q" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?v=haIz5govgW0>" %}

<br>
