How can I use Cart and Checkout Validation Function to validate minimum order value?

Topic summary

Enforcing a $1,500 minimum order using Shopify’s Cart and Checkout Validation Function. The current implementation checks cart subtotal and returns an error if below $1,500.

Problem: The validation fires when the shopper clicks “Add to cart,” blocking cart additions (video link provided), rather than validating only at checkout.

Key guidance: Use buyerJourney (and buyerJourneyStep) in the validation function to scope when the rule runs. By checking the current buyer journey step, you can allow adding items to the cart while enforcing the minimum only during checkout. Documentation links for buyerJourney and buyerJourneyStep were shared.

Outcome so far: Another participant confirmed the guidance was helpful. No code example was provided in-thread for the condition check.

Open questions: A follow-up asks about the flow and how exactly to use buyerJourneyStep to pass validation on add-to-cart while enforcing it later. The discussion remains open without a concrete implementation snippet.

Summarized with AI on December 18. AI used: gpt-5.

You need to use buyerjourney step.

https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql/common-objects/buyerjourney

https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql/common-objects/buyerjourneystep

2 Likes