Overview
The order limits configuration allows you to set minimum and maximum order amounts for your water delivery service. This helps ensure order profitability and manage delivery logistics.Configuration File
Order limits are defined insrc/config/orderLimits.js:2-17.
Configuration Options
Minimum order amount in Turkish Lira (TL)Orders below this amount will be rejected during checkout.
Enable or disable minimum order validationSet to
false to allow orders of any amount.Error message shown when order is below minimum amountUse
{minimumOrderAmount} placeholder to display the configured amount.Note: The placeholder in code is {amount} but displays as {minimumOrderAmount} in the actual message template.Maximum order amount in Turkish Lira (TL)Set to
null for no maximum limit.Error message shown when order exceeds maximum amountUse
{amount} placeholder to display the configured maximum.Usage Examples
Validate Order Amount
src/config/orderLimits.js
Check Minimum Order Only
src/config/orderLimits.js
Check Maximum Order Only
src/config/orderLimits.js
Configuration Examples
Standard Minimum Order
src/config/orderLimits.js
With Maximum Limit
src/config/orderLimits.js
No Minimum Requirement
src/config/orderLimits.js
Custom Messages
src/config/orderLimits.js
Validation Logic
The validation system works as follows (seesrc/config/orderLimits.js:52-64):
Check Minimum
First,
checkMinimumOrder() is called. If minimum is enabled and order is below the threshold, validation fails with the minimum message.Check Maximum
If minimum passes,
checkMaximumOrder() is called. If a maximum is set and order exceeds it, validation fails with the maximum message.Return Value Structure
All validation functions return the same structure:Message Placeholders
Integration Example
Here’s how to integrate order validation in a checkout flow:Best Practices
Set Realistic Minimums
Balance profitability with customer accessibility. Too high minimum orders may lose customers.
Clear Messaging
Customize error messages to explain why limits exist (e.g., delivery costs, logistics).
Show Progress
Display how much more customers need to add to reach minimum order.
Consider Regions
You may want different limits for different delivery areas in the future.
Related Configuration
- Service Hours - Control when orders can be placed
- Damacana Limits - Special time restrictions for water jugs