> For the complete documentation index, see [llms.txt](https://magecomp.gitbook.io/shopify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://magecomp.gitbook.io/shopify/apps/skelta-buy-x-restrict-y/collections.md).

# Collections

If you want to create restrictions on collections, perform the following steps.

<mark style="color:blue;">**Step #1**</mark>

Go to **Dashboard** <mark style="color:blue;">➤</mark> **Collections**

<mark style="color:blue;">**Step #2**</mark>

Select the  **Create Collection Rule** button to add the collections you want to create restrictions for.&#x20;

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

Use **Collection Dependency** rules when certain collections must be purchased together. If a customer adds a product from the primary collection to their cart, products from the required target collections must also be included.

### 1. Select Rule Type

Choose how the collections should interact:

#### **Restriction**

Products from the selected collections **cannot be purchased together**. If a customer adds one collection's product to the cart, products from the restricted collection cannot be added.

#### **Dependency**

Products from the selected collections **must be purchased together**. If a customer adds a product from the primary collection, products from the target collections become required.

{% hint style="info" %}
**Example:** If "Coffee Machines" is the primary collection and "Coffee Pods" is the target collection, customers purchasing a coffee machine must also purchase coffee pods.
{% endhint %}

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

### 2. Primary Collection

Select the main collection that triggers the rule.

* Click **Select Collection**.
* Choose the collection that should activate the dependency or restriction rule.
* When a customer adds a product from this collection to their cart, the rule will be applied.

{% hint style="info" %}
**Example:** Select **Laptop** as the primary collection.
{% endhint %}

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

### 3. Target Collections

Select one or more collections that will be linked to the primary collection.

* Click **Select Collections**.
* Choose the collections that are required (for Dependency) or restricted (for Restriction).
* Multiple collections can be selected.

{% hint style="info" %}
**Example:** If **Laptop** is the primary collection and **Laptop Bag** and **Mouse** are target collections, customers must also purchase products from these collections when buying a laptop.
{% endhint %}

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