Overview
Damacana (water jug) products have special time restrictions for ordering. This configuration allows you to set cutoff times when damacana orders are no longer accepted, with support for different hours on weekends.Damacana products are identified by their ID pattern. By default, any product ID ending in
1 (like 11, 21, 31, 81) is considered a damacana.Configuration File
Damacana restrictions are defined insrc/config/damacanaLimits.js:2-30.
Configuration Options
Weekday Settings
Hour when damacana orders stop being accepted (24-hour format)Orders placed after this time will be rejected until
startHour the next day.Minute component of the cutoff time
Hour when damacana orders start being accepted again (24-hour format)
Minute component of the start time
Weekend Settings
Whether to use different cutoff times on weekends (Saturday-Sunday)If
false, weekday times are used for all days.Weekend cutoff hour (only used if
weekendEnabled is true)Default is 1 hour earlier than weekday cutoff.Weekend cutoff minute
Weekend start hour
Weekend start minute
System Settings
Enable or disable damacana time restrictions entirelySet to
false to allow damacana orders at any time.When enabled, time restrictions are bypassed
Regular expression to identify damacana products by IDDefault pattern
/1$/ matches IDs ending in 1: 11, 21, 31, 41, 51, 61, 71, 81Error message shown when orders are placed outside allowed hoursUse
{cutoffTime} and {startTime} placeholders.Usage Examples
Check if Product is Damacana
src/config/damacanaLimits.js
Check if Damacana Orders are Allowed
src/config/damacanaLimits.js
Validate Cart for Damacana Products
src/config/damacanaLimits.js
Get Formatted Order Hours
src/config/damacanaLimits.js
Configuration Examples
Standard Weekday-Only Configuration
src/config/damacanaLimits.js
With Different Weekend Hours
src/config/damacanaLimits.js
Custom Product Pattern
src/config/damacanaLimits.js
How It Works
The damacana restriction logic follows these steps (seesrc/config/damacanaLimits.js:40-106):
Determine Time Settings
Check if today is weekend (Saturday or Sunday). If
weekendEnabled is true, use weekend-specific hours.Check Restricted Period
Since
cutoffHour (19) is greater than startHour (8), the restricted period spans midnight:- Orders are blocked from 19:00 → 23:59 (same day)
- Orders are blocked from 00:00 → 08:30 (next day)
- Orders are allowed from 08:30 → 19:00
Restricted Period Logic
The key logic for overnight restrictions:src/config/damacanaLimits.js
With default settings (cutoff: 19:00, start: 08:30), customers cannot order damacana between 19:00 and 08:30 the next day. They can order between 08:30 and 19:00.
Return Value Structure
Validation functions return this structure:Integration Example
Debug Logging
The system includes extensive console logging for troubleshooting (seesrc/config/damacanaLimits.js:35-105):
Best Practices
Match Your Logistics
Set cutoff times based on your actual delivery capacity for water jugs.
Clear Communication
Display damacana ordering hours prominently on product pages.
Weekend Adjustments
Consider earlier cutoffs on weekends if you have reduced delivery staff.
Test Product Pattern
Verify your
damacanaIdPattern matches all relevant products correctly.Related Configuration
- Service Hours - Overall store operating hours
- Order Limits - Minimum and maximum order amounts