To prevent a product from being purchased alone on Shopify, define the item that requires a companion, identify the acceptable companion product or group, and add a cart and checkout validation that blocks this condition:
Restricted product is present AND required companion is absent.
The error message should name what is missing and tell the shopper how to fix the cart. This pattern works for refills that require a starter kit, products that need an installation service, components sold only with compatible hardware, and promotional items that must accompany a qualifying purchase.
What does “cannot be purchased alone” mean?
A product dependency rule makes one item conditional on another. The dependent product remains available, but the shopper cannot complete checkout unless the cart also contains an approved companion.
For example, imagine a coffee machine cleaning cartridge that should only be sold with a compatible machine or care kit. The invalid cart is:
Cleaning cartridge is present AND compatible machine or care kit is absent.
The direction matters. If the machine can be purchased without the cartridge, the rule should not block a machine-only cart. It should block only the cartridge-only cart.
This is different from preventing incompatible products from being purchased together on Shopify. An incompatibility rule blocks a prohibited pair when both are present. A dependency rule blocks a product when its required companion is missing.
When should you require a companion product?
Use a product dependency when the dependent item has no valid standalone use or your written sales policy requires another item in the same order. Common examples include:
- A refill, replacement part, or accessory that requires a compatible base product.
- An installation or assembly service that must accompany the relevant product.
- A warranty, customization, or add-on that cannot be sold without an eligible item.
- A free sample or promotional item that requires a qualifying product.
- A component that must ship with a safety kit, adapter, or required consumable.
- A wholesale inner pack that must accompany a case or master product.
Do not use checkout validation simply to encourage an upsell. If the companion is optional, recommend it on the product or cart page instead of blocking the purchase.
Should you use a bundle, automatic add, or validation rule?
The right setup depends on whether the shopper should choose the companion and whether the products need to remain separate in the catalog.
| Approach | Best when | What the shopper experiences |
|---|---|---|
| Fixed bundle | The products should always be sold as one predefined offer | The shopper adds one bundle product containing all required components |
| Automatic add | The companion should be inserted into the cart without shopper selection | The cart adds the required item when the trigger product qualifies |
| Cart and checkout validation | The shopper may choose from approved companions, or existing products must remain separate | Checkout is blocked only while the dependent product lacks an approved companion |
Shopify Bundles can create fixed bundles and multipacks on eligible sales channels. A bundle is usually cleaner when the relationship never changes and shoppers should perceive the items as one offer.
Validation is more flexible when the shopper can choose one of several acceptable companion products, the dependency applies only to certain customers or markets, or the catalog must keep each item independently purchasable for other workflows.
Can Shopify require one product when another is in the cart?
Shopify provides the Cart and Checkout Validation Function API for apps and custom development. These server-side functions can inspect cart data and return an error that prevents a shopper from completing checkout when a business rule is not met. Shopify documents support for standard cart and checkout flows as well as express checkout options, but each store should test the purchase paths it enables.
Merchants who do not want to build and maintain a custom Shopify Function can use a validation app. CartBlock supports product-, variant-, collection-, tag-, quantity-, and other cart conditions, along with configurable shopper messages. Confirm that the condition combination and display surface you need are available on the current plan before activating the rule.
How to design a “required companion” rule
Write the policy in plain language before opening a rule builder. Define these 5 fields:
- Dependent product: the item that cannot be purchased alone.
- Acceptable companion: one product, variant, tag, or collection that satisfies the rule.
- Minimum requirement: whether 1 qualifying companion is enough or quantities must match.
- Scope: customers, markets, purchase channels, or other conditions to which the policy applies.
- Correction: the exact action the shopper must take.
Here is a simple specification:
| Policy field | Example value |
|---|---|
| Dependent product | Installation service |
| Acceptable companion | Any product tagged installation-eligible
|
| Invalid state | Installation service present AND no eligible product present |
| Valid state | At least 1 eligible product is in the same cart |
| Shopper action | Add an eligible product or remove the service |
| Error message | Installation service requires an eligible product in your cart. Add the product or remove the service to continue. |
Avoid starting with interface labels. A written specification makes it easier to catch reversed logic, decide who maintains product tags, and build a complete test plan.
How to prevent a product from being purchased alone with CartBlock
CartBlock's interface and plan entitlements can change. Compare the following workflow with the installed rule builder and the current CartBlock product-rule guide.
1. Create a validation
Open CartBlock in Shopify admin and choose Create validation. Select the validation type that supports the product conditions you need.
Give the validation a precise internal title, such as Installation service requires eligible product. A clear name helps your team understand the rule without opening it.
2. Identify the dependent product
Add a condition that becomes true when the dependent product is in the cart. Target the exact product or variant when the rule has a narrow scope. Use a maintained product tag or collection when the same policy applies to a changing group of items.
For example:
Cart contains any product tagged installation-service.
Check the current comparison labels in the interface. “Contains,” “equals,” and quantity comparisons can produce different results.
3. Check for the required companion
Add a second condition that becomes true when the acceptable companion is missing. For example:
Cart contains 0 products tagged installation-eligible.
The validation should trigger when the dependent item is present AND the qualifying companion is absent:
Dependent present AND companion absent → block checkout.
Do not reverse the second condition. If you block when the companion is present, you create the opposite of the intended policy.
If several products can satisfy the dependency, group them under one maintained tag or collection where practical. If each companion has different compatibility rules, use separate, clearly named validations rather than a single rule that is difficult to audit.
4. Decide whether quantities must match
A presence check answers only whether at least 1 acceptable companion is in the cart. It does not guarantee a 1:1 quantity relationship.
Suppose a shopper adds 3 installation services and 1 eligible product. Decide whether that cart is valid before launch:
- Presence rule: 1 companion satisfies the requirement regardless of dependent quantity.
- Matching rule: each dependent unit requires 1 companion unit.
- Capacity rule: 1 companion can support a defined number of dependent units.
Use quantity conditions only if the current rule builder can express the written policy accurately. If it cannot, use a fixed bundle or custom implementation instead of publishing a weaker rule.
5. Write an actionable error message
Tell the shopper what is missing and give both valid ways forward.
Good:
Installation service requires an eligible product in your cart. Add an eligible product or remove the service to continue.
Weak:
Cart validation failed.
Avoid exposing internal product tags or rule names. If many products satisfy the requirement, link to a collection or name the category in language shoppers recognize.
6. Choose where shoppers see the message
Use the product, cart, and checkout surfaces supported by the current configuration. An early message can explain the requirement before the shopper reaches checkout, while server-side checkout validation provides the enforcement point.
A theme notice by itself is not reliable enforcement. Shoppers may use a cart drawer, a buy button, or an express checkout path that bypasses the page containing the notice.
7. Save and test before launch
Activate the rule in a development store or controlled test workflow first. Confirm that it blocks only the incomplete cart and clears as soon as the shopper adds an acceptable companion or removes the dependent product.
Test matrix for a Shopify product dependency rule
Test the rule as a set of cart states, not as a single successful example.
| Test cart | Expected result |
|---|---|
| Dependent product only | Blocked with the correct message |
| Companion product only | Allowed |
| Dependent product and valid companion | Allowed |
| Dependent product and unrelated product | Blocked |
| Dependent product, valid companion, and unrelated item | Allowed |
| 2 dependent units and 1 companion | Matches the documented quantity policy |
| Dependent product removed after error | Allowed without a stale message |
| Valid companion removed after passing | Blocked |
| Newly tagged dependent product without a companion | Blocked |
| Product missing the intended tag | Test exposes the catalog gap |
Repeat the critical cases for guest and signed-in shoppers, the standard cart and checkout, and every express checkout option enabled on the store. Test subscriptions, bundles, draft orders, B2B, and custom storefront paths separately if they are part of your operation. Record unsupported paths instead of assuming identical behavior.
Common mistakes to avoid
Blocking the companion instead of the dependent product
Write the invalid state before configuring the rule. The trigger is “dependent present and companion absent,” not “companion present.”
Using OR between the 2 conditions
An OR rule can block carts whenever the dependent product is present or whenever the companion is missing, which may affect unrelated orders. The basic dependency requires both conditions to be true at the same time.
Treating presence as quantity matching
One companion product may satisfy a presence check even when the cart contains several dependent units. Add quantity logic only after defining the intended ratio.
Relying on a cart-page warning
A warning tells shoppers about the policy, but it may not enforce it across every checkout path. Use validation at the purchase point and test all enabled paths.
Forgetting catalog maintenance
Tag- and collection-based rules depend on accurate product classification. Assign an owner to update the group whenever products launch, retire, or change compatibility.
Hiding the remedy
“Product cannot be purchased alone” identifies the problem but leaves the shopper at a dead end. Name the required category and explain whether to add the companion or remove the dependent item.
How to maintain the rule after launch
Keep a small policy record with the rule name, business reason, dependent group, acceptable companions, quantity requirement, shopper message, owner, activation date, and latest test result.
Retest when you add products, change tags or collections, install a bundle or subscription app, update the theme, or change checkout behavior. For seasonal catalogs, review the rule before each launch. For a frequently changing catalog, include product dependency classification in the merchandising checklist.
Launch checklist
- Define the dependent product and every acceptable companion.
- Write the invalid state as “dependent present AND companion absent.”
- Decide whether presence or matching quantity is required.
- Choose products, variants, tags, or collections deliberately.
- Confirm current CartBlock condition and plan availability.
- Write a message that names the missing item and correction.
- Test incomplete, complete, unrelated, and boundary carts.
- Test standard and express checkout paths used by the store.
- Assign an owner for catalog classification and retesting.
- Record the rule, test date, and reviewer.
Frequently asked questions
Can Shopify require a second product before checkout?
Yes. A cart and checkout validation can inspect the cart and return an error when a dependent product is present without an approved companion. You can implement the logic through custom development or a validation app that supports the necessary product conditions.
Can one of several products satisfy the requirement?
Yes, if the rule targets an approved group such as a product tag or collection. Maintain that group carefully so new products do not qualify or fail unexpectedly.
Can the rule require equal quantities?
Only if the implementation can compare the relevant quantities. A basic presence rule does not enforce a 1:1 ratio. Test mismatched quantities before launch.
Is a product bundle a better option?
Use a fixed bundle when the products should always be sold as a single offer. Use validation when products remain separate, shoppers can choose among several companions, or the dependency applies only under defined conditions.
Will the rule work with Shop Pay and other express checkouts?
Shopify documents express checkout support for Cart and Checkout Validation Functions. App configurations and store paths can differ, so test every enabled option before relying on the rule.
Make every dependency clear before checkout
To prevent a product from being purchased alone, keep the dependency rule narrow and easy to correct: identify the dependent item, define the acceptable companion, block only when the companion is absent, and test every meaningful cart state.
Explore CartBlock on the Shopify App Store to enforce product-based purchase requirements with configurable validation rules. Confirm current plan eligibility and test the installed rule before activating it on a live store.

Install Now