WebRainbow - Delivery Date
Adds validated delivery-date rules to WooCommerce classic and block checkouts.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mido1983/wp-custom-delivery-date/archive/refs/heads/main.zipWooCommerce delivery-date rules for classic checkout and Checkout Blocks.
Requirements
- WordPress with the site timezone configured correctly
- WooCommerce 8.9 or newer
- PHP 7.4 or newer
Delivery rules
The server is the source of truth. A submitted date must satisfy every applicable rule:
- Minimum lead time and the optional priority-category cutoff.
- Global booking horizon and every product's “deliver no later than” date.
- Default weekdays, matching category restrictions, and product restrictions.
- Excluded dates and the optional December 27–January 2 closure.
- The configured city list for the restricted weekday.
Weekday restrictions are intersected. If one cart item allows only Tuesday and another allows only Friday, the cart has no valid delivery weekday and checkout displays a warning.
The priority-category rule includes descendant product categories. Local-pickup orders and carts that do not need shipping do not require a delivery date.
Upgrade notes from 2.x
- Existing
webrainbow_delivery_date_settingsoptions and product metadata remain supported. - Existing classic orders continue using
_delivery_date. - Checkout Blocks store their value through WooCommerce's Additional Checkout Fields API.
- The old hardcoded timezone was removed; calculations now use the WordPress site timezone.
- The Wednesday city restriction is now enforced on the server. Review the configured city spellings after updating.
- Rules previously shown in the admin UI but ignored by checkout are now active.
Development checks
php -l custom-delivery-date.php
node --check assets/js/frontend.js
node --check assets/js/admin.js
composer install
vendor/bin/phpunit
vendor/bin/phpcs
The PHPUnit suite expects the standard WordPress test library in WP_TESTS_DIR.