# Creating a Checkout Lock

This Lock type prevents customers from completing checkout with restricted products. Customers can still add those products to the cart, but the order will be blocked once they proceed to checkout.&#x20;

An error message will appear to inform customers of the reason:

<figure><img src="/files/RfofI29j0cCfrEj5pT8c" alt=""><figcaption></figcaption></figure>

**Step to manage:**

1. From the app's dashboard page > go to **Locks** page > **Create lock** > Choose lock content: **Checkout lock**

<figure><img src="/files/445Mye5shF4XEjTRkScb" alt=""><figcaption></figcaption></figure>

2. Set up **name** for the lock and **turn on the lock** in the Lock status part

<figure><img src="/files/uoDxlDvGQilM1TBeq10W" alt=""><figcaption></figcaption></figure>

2. In the **Conditions settings** setting, set up condition to apply this lock for products.&#x20;

If a customer proceeds to checkout and either the cart items or the customer information match the rules configured in the app, the system will **automatically display an error message on the checkout page**. In this case, the customer will **not be able to complete the checkout and create the order**.

There are currently **7 conditions**. It can be applied based on Product condition or Customer condition:&#x20;

<figure><img src="/files/y61N1xPYuwS3hEUzeOji" alt=""><figcaption></figcaption></figure>

For example, restrict 2 products from being paid at checkout

* Please use condition: **Select products > Select items**&#x20;

<figure><img src="/files/qYxwAdV0lHlXsoVShV8O" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/E38uXmUsYqd5WCij1Sl7" alt=""><figcaption></figcaption></figure>

* Click **Add another condition** to have more rules for this lock:

<figure><img src="/files/Hx2I4BP4uURKUZMi9MyB" alt=""><figcaption></figcaption></figure>

* There are **two types of error messages**:
  1. **Custom message** – a general notification shown to the customer.
  2. **Condition-based messages** – displayed based on the specific conditions configured in the app, helping the customer understand the exact reason why checkout is not allowed.

<figure><img src="/files/FAUYJb7TT2OuuxJ2Ugk9" alt=""><figcaption></figcaption></figure>

In this case, the default error messages shown to customers are:&#x20;

*‘Product {title} cannot be checked out’* and *‘Your email is not eligible for checkout’*

These appear based on the conditions you configured: **Select products (block listed)** and **Customer email (is equal to)**

[***How to translate the texts there to another language?*** ](https://docs.samita.io/b2b-lock-password-protect/settings/translate-checkout-rules-default-messages)

4. After finishing the setup, click **Save**.

***

You have finished the Lock setup part. Now to officially activate the lock rule at checkout page, you have to add **Sami B2B Lock** to your **Shopify Checkout page**.

1. Go to **Shopify Settings** > **Checkout** > Scroll down to the bottom of the page > **Checkout rules** > **Add rule**:

<figure><img src="/files/G4NqeFD48VnbTfLTzhtr" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CeSF6cD6eOB3zMvTbzCG" alt=""><figcaption></figcaption></figure>

2. Click **Validation** to complete the checkout rules:

<figure><img src="/files/wgSCwsWrwrDkG0jFOLVa" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1VqtMUTytD6FWCvHgnJh" alt=""><figcaption></figcaption></figure>

3. **Turn on** the validation:

<figure><img src="/files/K1eWBnkEXGGPP8vStLgP" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6oyZOuLn18uG5pxnc8gi" alt=""><figcaption></figcaption></figure>

The configuration is completed. You can check the result in the front store now.&#x20;

{% hint style="info" %}
Don't forget to activate the app in your theme. Kindly refer to [this document](https://docs.samita.io/b2b-lock-password-protect/general-1/enable-app-embeds-on-theme) to know how to embed the app.&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.samita.io/b2b-lock-password-protect/lock-1/creating-a-checkout-lock.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
