> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/resources/tutorials/offer-three-items-for-30.md).

# Offer three items for $30

Build a group-price discount and check the price a shopper pays with two or three eligible items.

Suppose you want shoppers to mix and match three T-shirts for $30. You can try the offer with the sample shirts first, then choose the collection that qualifies in your shop.

## 1. Open the starting point

In Mechanic, open **Functions**. If you already have functions, choose **Create function**. Under **Featured starting points**, choose **Three items for $30**. Give the draft a name you’ll recognize.

<figure><img src="https://3145272362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQrnkixbmVHvKHMwAbm%2Fuploads%2Fgit-blob-9cab99db20d63ccb07a32d4377afce3d06cfd794%2Ffunctions-starting-points.png?alt=media" alt="The Functions chooser with Three items for $30 under Featured starting points"><figcaption></figcaption></figure>

## 2. Check both sides of the offer

In **Test cart**, choose **3 qualifying items**. Two black shirts at $18 each and a white shirt at $14 would usually cost $50. Look for a $20 discount and a $30 total.

Switch to **2 qualifying items**. One black shirt and one white shirt cost $32. The discount should be zero because the shopper hasn’t chosen a complete group of three. You can save both test carts with their expected results and run them again after editing the rule.

<figure><img src="https://3145272362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQrnkixbmVHvKHMwAbm%2Fuploads%2Fgit-blob-69f1b91d7001188b354990295b8a03fe687c5894%2Ffunctions-three-shirts.png?alt=media" alt="The group-price rule and a three-shirt test cart with a $50 subtotal, a $20 discount, and a $30 total"><figcaption></figcaption></figure>

## 3. Choose what qualifies in your shop

Under **Rule logic**, edit **Discounted items** and choose your own eligible collection. The sample shirts let you try the math before making this choice. Choose **Save draft**.

Choose **Try with my products** to test variants from your shop. Try three eligible shirts, then replace one with an item outside the collection. Only the cart with three qualifying shirts should get the group price.

## 4. Publish when you want shoppers to receive the offer

Under **Live checkout**, choose **Publish saved version**, review the offer, and choose **Confirm publish**. If Mechanic requests access, review the Shopify permissions above the test cart first.

Once Shopify confirms, use **Open in storefront** with a test cart of one-time variants from your shop to check the published offer. To end it, choose **Deactivate** under **Live checkout**. See [publishing and managing functions](https://learn.mechanic.dev/core/functions.md#publish-your-rule).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.mechanic.dev/resources/tutorials/offer-three-items-for-30.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
