> For the complete documentation index, see [llms.txt](https://docs.samita.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samita.io/b2b-lock-password-protect/lock-1/creating-a-checkout-lock.md).

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

### **Setup Checkout lock**

**Step to manage:**

1. From the app's dashboard page > go to **Locks** page > **Create lock**&#x20;
2. In the **Lock setup** tag, set up Lock name.&#x20;
3. In the **Content to lock** section, choose content: **Checkout lock**

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

* Scroll to the **Product scope** section. You can set up this lock for **All products** or Specific products (**Manual products**)&#x20;

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

In this **Manual products** setting:&#x20;

* **Only selected products**: The lock will be applied for only some products added to this setting.&#x20;
* **All products except selected**: The lock will still be applied for All products but excludes the products added to the setting.&#x20;

<figure><img src="/files/7QCt2iXTCJPQHxuOKi2J" alt=""><figcaption></figcaption></figure>

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

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

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 4 conditions for Customer.&#x20;

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

*For example:*

*Restrict customers from being able to purchase all products in your store, unless they login to your store first.*&#x20;

* Please use condition: **Customer login**

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

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

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

* Set up Error message. This message will show at checkout page.&#x20;

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

5. After finishing the setup, click **Save** to complete the Lock setup.&#x20;

***

### **Add checkout rule in Shopify Checkout page**

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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
