Max order over time - required app feature

I am running a store which is acting more as a service. I allow customers to ‘purchase’ for free, shipping sacks in which they then send us recycled goods.

Specifically, I am looking to restrict customer purchases in the following way:

Each of my customers is allowed to order a specific total number of shipping sacks (e.g., 4), which I can preset for each individual customer.
This total can be reached either in a single purchase or across multiple purchases over time.
Once a customer reaches their limit, they should no longer be able to make any further purchases until I manually reset them.

I would like to manage this process using customer tags:

A tag is applied to customers when they are authorized to order a specific quantity (e.g., a tag like allow-4-items).
Once they reach their limit, another tag (e.g., limit-reached) is applied to prevent further orders.
When resetting a customer, I would remove the limit-reached tag or reapply the initial allow-4-items tag to reset their limit.

I am finding that many sales limit apps don’t offer a way to accumulatively manage the sales over time, and by way of example, one of my customers may order 1 sack per week for 4 weeks, and then ship all 4 back to us in week 5. I need to stop him ordering after the 4th sack, and so prompt a return.

Essentially, I need an app that allows me to control max number of purchases of a single product over a period of time, by using tags

can anyone point me to something?

Best regards

Hi @Recycaball

To achieve the functionality you’re looking for, you’ll need an app or a combination of tools that allows you to enforce cumulative purchase limits over time, managed through customer tags. Here are a few recommendations and potential solutions:

1. Use an App Like “Mechanic”

The Mechanic app is one of the most flexible apps for Shopify, designed to automate custom workflows. Here’s how you can use it to achieve your goal:

  • Set Up Customer Tagging Logic:
  • Create a Mechanic task that tracks the number of orders a customer places for your shipping sacks product.
  • The task will automatically add a tag like limit-reached when a customer hits their preset limit (e.g., 4 sacks).
  • It will also look for the tag allow-4-items to determine if the customer is authorized.- Prevent Further Orders:
  • Another Mechanic task can check for the limit-reached tag when a customer attempts to make a purchase. If present, the task can prevent checkout by removing the product from the cart or showing an error message.- Reset the Limit:
  • Use Mechanic to reset limits manually by reapplying the allow-4-items tag or removing the limit-reached tag.

Example Mechanic Code Snippet (simplified logic for tagging):

{% for line_item in order.line_items %}

{% if line_item.product_id == ‘YOUR_PRODUCT_ID’ %}

{% assign current_count = customer.tags | split: ‘,’ | select: ‘purchased-x-items’ %}

{% assign new_count = current_count | plus: line_item.quantity %}

{% if new_count >= 4 %}

{% customer.tags = customer.tags | remove: ‘allow-4-items’ %}

{% customer.tags = customer.tags | append: ‘,limit-reached’ %}

{% else %}

{% customer.tags = customer.tags | remove: ‘purchased-x-items’ %}

{% customer.tags = customer.tags | append: ‘,purchased-’ | append: new_count | append: ‘-items’ %}

{% endif %}

{% endif %}

{% endfor %}

2. Try an App Like “Order Limits”

Apps like Order Limits by Mageworx or Limitsify might also work if configured correctly. However, these apps generally manage limits per order rather than cumulative limits over time. Combining one of these apps with a customer tagging system via Shopify Flow or Mechanic could bridge the gap.

3. Custom Development Solution

If your requirements aren’t fully met by existing apps, a custom app could be developed to handle this. A developer could:

  • Track cumulative purchases for specific customers.
  • Apply tags dynamically based on purchase counts.
  • Block customers with a limit-reached tag at checkout.

Final Thoughts

From what you’ve described, Mechanic seems like the most adaptable and scalable solution because it provides the flexibility to implement and adjust your specific logic using custom workflows. If you’re comfortable with liquid code, you can tailor it precisely to your needs. If not, you might want to consult a Shopify expert to set it up.

If you need any other assistance, feel free to reply and I will try my best to respond.
Best regards,
Daisy

Here’s a no-code and a low-code way to enforce “4-sack” limits per customer using tags:


1. Zero-Code: ToolsForShop “Purchase Limits” Module

  1. Install ToolsForShop.

  2. In the app’s dashboard go to “Order Controls → Purchase Limits.”

  3. Create a new rule:

    • Product: your shipping-sack SKU
    • Limit type: Lifetime total
    • Quantity: leave blank (it’ll pull from tags)
    • Apply by: Customer Tag
  4. Configure tag mapping:

    • Tag allow-4-items ⇒ sets limit = 4
    • Tag allow-2-items ⇒ limit = 2
    • etc.
  5. Blocking behavior: when the tag’s limit is reached, ToolsForShop will automatically:

    • Prevent checkout of any more sacks
    • Apply a limit-reached customer tag
  6. Reset flow: when you’re ready to reopen orders, just remove limit-reached and re-apply (or update) the allow-X-items tag on that customer—and the counter resets.

Pros: zero code, lifetime tracking across multiple carts/orders, tag-driven, instant blocking.


2. Low-Code: Shopify Flow + Script Editor (Plus only)

If you’re on Shopify Plus, you can build this with Flow + a tiny Script:

  1. Shopify Flow

    • Trigger: Order Created

    • Condition: Order contains your sack product

    • Action:

      • Query (via Flow’s GraphQL) the total qty of that product this customer has ever ordered.

      • If total ≥ X (parsed from their allow-X-items tag), then:

        • Add limit-reached tag
        • Send you a Slack/email alert
  2. Checkout Script (in Script Editor)

    # In Scripts → Cart scripts
    customer = Input.cart.customer
    return unless customer
    
    limit_tag = customer.tags.find { |t| t =~ /^allow-(\d+)-items$/ }
    return unless limit_tag
    
    limit = limit_tag.match(/^allow-(\d+)-items$/)[1].to_i
    already_ordered = # fetch via ShopifyAPI or store in metafield
    
    if (already_ordered + Input.cart.line_items.map(&:quantity).sum) > limit
      message = "You’ve hit your #{limit}-sack limit. Please return your previous sacks before ordering more."
      Output.cart = Input.cart
      Output.cart.reject_checkout(message: message)
    end
    
  3. Manual Reset

    • In Shopify Admin, remove the limit-reached tag (and/or re-apply allow-X-items).
    • Flow’s next Order Created will recalc and allow ordering until the new limit is reached again.

Which to pick?

  • ToolsForShop is by far the quickest—entirely UI-driven, auto-tracks lifetime purchases, and uses the exact tag workflow you described.
  • Flow + Script gives you 100% flexibility if you need custom alerting or deeper integration.

Let me know if you need step-by-step setup for either approach!

Hi @Recycaball—here’s a zero-code way to hit exactly what you need using ToolsForShop:


ToolsForShop “Purchase Limits” (Tag-Driven, Lifetime Tracking)

  1. Install the app
    :right_arrow: ToolsForShop on the Shopify App Store

  2. Open the dashboard and go to Order Controls → Purchase Limits.

  3. Create a Rule for your shipping-sack product:

    • Product: Select your sack SKU.
    • Limit Type: Lifetime Total
    • Quantity Source: Customer Tag
  4. Map Tags to Limits

    • Add mappings like:

      • allow-4-items4
      • allow-2-items2
      • (Add as many as you need.)
  5. Define Block Behavior

    • When a customer’s cumulative orders reach their tag’s limit:

      • The checkout is automatically blocked for that product.
      • The customer is tagged with limit-reached.
  6. Manual Reset Flow

    • To reopen ordering, simply remove limit-reached and (re-)apply the appropriate allow-X-items tag on the customer record.
    • ToolsForShop will reset the counter and let them order again up to the new limit.

Why This Works for Your Use-Case

  • Accumulative Tracking: Counts across all past orders—whether they buy 4 in one order or 1 per week over 4 weeks.
  • Tag-Driven: You control each customer’s allowance via tags—no custom code or spreadsheets.
  • Instant Enforcement: As soon as they hit the limit, further “purchases” are blocked until you reset it.
  • Flexible Reset: Remove or update tags at any time to grant a fresh allowance.

If you’d like to see it in action or need a quick walkthrough of the Purchase Limits UI, let me know!

In case anyone else is interested – here is the flow I used for a similar task. No coding at all.
Just one difference – this solution uses metafield instead of tags (makes it easier to do calculations and comparisons).

When order is placed, if order customer has no metafield, the metafield is set to some initial value.

Then code loops over ordered products and if a product matches, it checks if quantity ordered is greater then the MF value. In this case the order is cancelled, customer is notified.

Otherwise, MF is decremented by the line item quantity.