> 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="https://922942541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIGRcMuVZCEGNibOl1OmW%2Fuploads%2FGMiQ9alkNa6u8pUZOptw%2Fimage.png?alt=media&amp;token=85c40a81-055b-47f0-911c-9c82c1cbbb02" 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="https://922942541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIGRcMuVZCEGNibOl1OmW%2Fuploads%2FTseZUVLkVbnCX4mz7Pa1%2Fimage.png?alt=media&amp;token=1fd94f0e-ca86-458a-a354-5c3c6ece3abd" 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="https://922942541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIGRcMuVZCEGNibOl1OmW%2Fuploads%2FMitcSUjNXRYOnutbyU4C%2Fimage.png?alt=media&amp;token=c678d03b-7b0c-451f-a09a-0b7c8cccf497" 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="https://922942541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIGRcMuVZCEGNibOl1OmW%2Fuploads%2FuC9hKiCMqWwRlej5ynoq%2Fimage.png?alt=media&amp;token=83c36b63-e18d-4140-ba66-c296661ca29c" alt=""><figcaption></figcaption></figure>
