Checkpost

How to limit free samples to 3 per Shopify order at checkout

Short answer: Cap the combined quantity of sample-tagged products at 3 per order, checking inside checkout even when a shopper skips the cart page. In Checkpost, choose “Maximum 3 samples per order” from Templates, adjust the values, test it, then save and enable the rule.

The problem

A fragrance merchant offered three samples per order and found that shoppers could skip cart warnings to order more. Checkout enforcement checks the combined sample quantity rather than trusting the cart interface.

Related merchant discussion on Shopify Community

How to set it up

  1. Install Checkpost from the Shopify App Store.
  2. Open Templates and choose Maximum 3 samples per order.
  3. Tag all sample products and set the per-order allowance. Configure free sample pricing separately.
  4. Use Try this rule to test a sample cart, then click Save rule.

The rule

Checkout is blocked when all of these conditions is true:

Shoppers see: “Choose up to 3 samples per order. Please remove the extra samples.” at the top of checkout, in the cart and at checkout.

Rule definition (JSON)
{
  "name": "Samples: max 3 per order",
  "match": "all",
  "conditions": [
    {
      "kind": "line_number",
      "field": "matching_quantity",
      "op": "gt",
      "value": 3,
      "filter": {
        "productTags": [
          "sample"
        ]
      }
    }
  ],
  "message": "Choose up to 3 samples per order. Please remove the extra samples.",
  "target": "cart",
  "runOn": "always"
}

Examples with the default settings

These outcomes apply to this rule alone. Other enabled rules may also affect checkout.

Test cartExpected outcome
2 rose samples + 1 citrus sampleAllowed by this rule
2 rose samples + 2 citrus samplesCheckout blocked

Where this rule works

These are cart and checkout validations, including supported accelerated checkouts. They are current-cart policies; they do not track previous purchases of a SKU. Shopify excludes POS, recurring subscription orders and native pre-order/Try Before You Buy flows from this API. See Shopify's validation compatibility.

Tips

FAQ

Does three mean three scents or three units?

Three units in total. Two units of one scent and one of another use the full allowance.

Does the customer have to visit the cart page?

No. The validation also runs at supported Shopify checkout entry points; a cart-page warning is not the enforcement mechanism.

Related rules

Add maximum 3 samples per order to your store