# Magento 2 Delivery Dates

Magento 2 Delivery Dates extension allows customers to select delivery dates during checkout with admin-configurable disabled dates. Includes calendar widget, date validation, and admin management UI for controlling available delivery dates.

## Features
- Calendar widget for delivery date selection in checkout
- Admin UI to manage disabled/unavailable dates
- Database-backed disabled dates configuration
- Grid management interface for bulk operations
- ACL controls for admin access

## Requirements
- PHP >= 7.4.0
- Magento 2 Framework >= 103.0.0
- Associated Magento modules (Backend, Catalog, Quote, Sales)

## Installation
1. Add the repository to your root composer.json if this is a private package.
2. Require the module:

```bash
composer require portalpeople/magento-deliverydates
```

3. Enable the module and run setup:

```bash
bin/magento module:enable PortalPeople_DeliveryDates
bin/magento setup:upgrade
bin/magento cache:flush
```

## Configuration
Admin controls for managing disabled dates are available at:
- Admin > Delivery Dates > Manage Dates

The module uses database schema defined in:
- `src/etc/db_schema.xml`

## Usage
Customers see a calendar widget on the checkout page (frontend layout in `src/view/frontend/layout/default.xml`) where they can select their preferred delivery date. Disabled dates are displayed and cannot be selected.

## Database
The extension creates tables for storing disabled delivery dates:
- Installation schema: `src/Setup/InstallSchema.php`
- Whitelist: `src/etc/db_schema_whitelist.json`

## Admin UI
- Grid view: `/admin/disableddates/index/index`
- Add/Edit form with form component: `src/view/adminhtml/ui_component/portalpeople_disabled_dates_form.xml`
- Grid component: `src/view/adminhtml/ui_component/portalpeople_disabled_dates_grid.xml`

## License
MIT
