Plugin Directory

Changeset 3754237


Ignore:
Timestamp:
10/19/2026 08:02:29 AM (2 weeks ago)
Author:
NitsPatel
Message:

Add Disabled Weekdays, Minimum Lead Time and Maximum Booking Window
settings, enforced in the date picker and server-side. Remove dead and
duplicate code

Location:
delivery-date-time-slot-picker-for-woocommerce
Files:
22 added
9 edited

Legend:

Unmodified
Added
Removed
  • delivery-date-time-slot-picker-for-woocommerce/trunk/assets/js/delivery-datepicker.js

    r3560865 r3754237  
    2525        }
    2626
     27        function getDisabledWeekdays() {
     28                if (
     29                        window.delidaamCheckout &&
     30                        Array.isArray( window.delidaamCheckout.disabledWeekdays )
     31                ) {
     32                        return window.delidaamCheckout.disabledWeekdays.map( Number );
     33                }
     34
     35                return [];
     36        }
     37
     38        function getMinDays() {
     39                return window.delidaamCheckout ? parseInt( window.delidaamCheckout.minDays, 10 ) || 0 : 0;
     40        }
     41
     42        function getMaxDays() {
     43                return window.delidaamCheckout ? parseInt( window.delidaamCheckout.maxDays, 10 ) || 0 : 0;
     44        }
     45
    2746        function isBlockCheckoutField( input ) {
    2847                return (
    … …  
    154173                        {
    155174                                dateFormat: 'yy-mm-dd',
    156                                 minDate: 0,
     175                                minDate: getMinDays(),
     176                                maxDate: getMaxDays() > 0 ? getMaxDays() : null,
    157177                                beforeShow: function( currentInput, instance ) {
    158178                                        window.setTimeout(
    … …  
    167187                                        var dateString = $.datepicker.formatDate( 'yy-mm-dd', date );
    168188
    169                                         return [ -1 === blockedDates.indexOf( dateString ) ];
     189                                        var weekdayBlocked = -1 !== getDisabledWeekdays().indexOf( date.getDay() );
     190
     191                                        return [ -1 === blockedDates.indexOf( dateString ) && ! weekdayBlocked ];
    170192                                },
    171193                                onSelect: function( dateText ) {
  • delivery-date-time-slot-picker-for-woocommerce/trunk/delivery-date-time-slot-picker-for-woocommerce.php

    r3732053 r3754237  
    44 * Plugin URI: https://wordpress.org/plugins/delivery-date-time-slot-picker-for-woocommerce
    55 * Description: Allows customers to select delivery date and time slot at WooCommerce checkout. Supports blackout dates and slot limits.
    6  * Version: 1.7
     6 * Version: 1.8
    77 * Author: NitsPatel
    88 * Author URI: https://github.com/NiteshPatel-1988
    … …  
    4444}
    4545
    46 define( 'DELIDAAM_DELIVERY_VERSION', '1.7' );
     46define( 'DELIDAAM_DELIVERY_VERSION', '1.8' );
    4747define( 'DELIDAAM_DELIVERY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    4848define( 'DELIDAAM_DELIVERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • delivery-date-time-slot-picker-for-woocommerce/trunk/includes/class-delidaam-blocks-compat.php

    r3720989 r3754237  
    156156                        );
    157157                }
     158
     159                if ( in_array( (int) $date->format( 'w' ), self::get_disabled_weekdays(), true ) ) {
     160                        return new \WP_Error(
     161                                'delidaam_disabled_weekday',
     162                                __( 'Delivery is not available on the selected day of the week. Please choose a different date.', 'delivery-date-time-slot-picker-for-woocommerce' )
     163                        );
     164                }
     165
     166                if ( $value < self::get_earliest_date() ) {
     167                        return new \WP_Error(
     168                                'delidaam_too_soon',
     169                                __( 'The selected delivery date is too soon. Please choose a later date.', 'delivery-date-time-slot-picker-for-woocommerce' )
     170                        );
     171                }
     172
     173                $latest = self::get_latest_date();
     174
     175                if ( '' !== $latest && $value > $latest ) {
     176                        return new \WP_Error(
     177                                'delidaam_too_far',
     178                                __( 'The selected delivery date is too far in the future. Please choose an earlier date.', 'delivery-date-time-slot-picker-for-woocommerce' )
     179                        );
     180                }
     181        }
     182
     183        /**
     184         * Get the weekdays (0 = Sunday ... 6 = Saturday) on which delivery is disabled.
     185         *
     186         * The setting stores Sunday as 7 because WooCommerce drops "0" when saving a multiselect.
     187         *
     188         * @return int[]
     189         */
     190        public static function get_disabled_weekdays() {
     191                $days = array();
     192
     193                foreach ( (array) get_option( 'delidaam_delivery_disabled_weekdays', array() ) as $day ) {
     194                        if ( is_numeric( $day ) && (int) $day >= 1 && (int) $day <= 7 ) {
     195                                $weekday          = (int) $day % 7;
     196                                $days[ $weekday ] = $weekday;
     197                        }
     198                }
     199
     200                // Never block every day of the week.
     201                return count( $days ) >= 7 ? array() : array_values( $days );
     202        }
     203
     204        /**
     205         * Minimum lead time in days.
     206         *
     207         * @return int
     208         */
     209        public static function get_min_days() {
     210                return max( 0, (int) get_option( 'delidaam_delivery_min_days', 0 ) );
     211        }
     212
     213        /**
     214         * Maximum booking window in days (0 = unlimited).
     215         *
     216         * @return int
     217         */
     218        public static function get_max_days() {
     219                return max( 0, (int) get_option( 'delidaam_delivery_max_days', 0 ) );
     220        }
     221
     222        /**
     223         * Earliest bookable date (Y-m-d) in the store timezone.
     224         *
     225         * @return string
     226         */
     227        private static function get_earliest_date() {
     228                return gmdate( 'Y-m-d', strtotime( current_time( 'Y-m-d' ) . ' UTC' ) + self::get_min_days() * DAY_IN_SECONDS );
     229        }
     230
     231        /**
     232         * Latest bookable date (Y-m-d) in the store timezone, or an empty string for no limit.
     233         *
     234         * @return string
     235         */
     236        private static function get_latest_date() {
     237                $max = self::get_max_days();
     238
     239                if ( $max <= 0 ) {
     240                        return '';
     241                }
     242
     243                return gmdate( 'Y-m-d', strtotime( current_time( 'Y-m-d' ) . ' UTC' ) + $max * DAY_IN_SECONDS );
    158244        }
    159245
    … …  
    322408                        'delidaamCheckout',
    323409                        array(
    324                                 'blackoutDates' => self::get_blackout_dates(),
     410                                'blackoutDates'   => self::get_blackout_dates(),
     411                                'disabledWeekdays' => self::get_disabled_weekdays(),
     412                                'minDays'         => self::get_min_days(),
     413                                'maxDays'         => self::get_max_days(),
    325414                                'dateFieldLabel' => __( 'Delivery Date', 'delivery-date-time-slot-picker-for-woocommerce' ),
    326415                        )
  • delivery-date-time-slot-picker-for-woocommerce/trunk/includes/class-delivery-date-time-picker.php

    r3732053 r3754237  
    2727        add_action('woocommerce_checkout_process', [$this, 'delidaam_validate_delivery_fields']);
    2828        add_action('woocommerce_checkout_create_order', [$this, 'delidaam_add_delivery_fields_to_order'], 10, 2);
    29         add_action('woocommerce_checkout_update_order_meta', [$this, 'delidaam_save_delivery_fields']);
    3029        add_action('woocommerce_admin_order_data_after_billing_address', [$this, 'delidaam_display_delivery_fields_admin'], 10, 1);
    3130        // Classic checkout thank-you page (always fires, HPOS-safe).
    … …  
    201200    }
    202201
    203     public function delidaam_save_delivery_fields( $order_id ) {
    204         $nonce = isset( $_POST['delidaam_delivery_nonce_field'] ) ? sanitize_text_field( wp_unslash( $_POST['delidaam_delivery_nonce_field'] ) ) : '';
    205 
    206         if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'delidaam_delivery_nonce_action' ) ) {
    207             return;
    208         }
    209 
    210         $order = wc_get_order( $order_id );
    211         if ( ! $order ) {
    212             return;
    213         }
    214 
    215         $needs_save = false;
    216 
    217         if ( isset( $_POST['delidaam_delivery_date'] ) ) {
    218             $delivery_date = sanitize_text_field( wp_unslash( $_POST['delidaam_delivery_date'] ) );
    219             if ( ! empty( $delivery_date ) ) {
    220                 $order->update_meta_data( self::DELIVERY_DATE_META_KEY, $delivery_date );
    221                 $needs_save = true;
    222             }
    223         }
    224 
    225         if ( isset( $_POST['delidaam_delivery_time_slot'] ) ) {
    226             $delivery_time_slot = sanitize_text_field( wp_unslash( $_POST['delidaam_delivery_time_slot'] ) );
    227             if ( ! empty( $delivery_time_slot ) ) {
    228                 $order->update_meta_data( self::DELIVERY_TIME_SLOT_META_KEY, $delivery_time_slot );
    229                 $needs_save = true;
    230             }
    231         }
    232 
    233         if ( $needs_save ) {
    234             $order->save();
    235         }
    236     }
    237 
    238202    /**
    239203     * Save delivery fields to the order object during checkout creation.
    … …  
    287251            echo '<p><strong>' . esc_html__( 'Delivery Time Slot', 'delivery-date-time-slot-picker-for-woocommerce' ) . ':</strong> ' . esc_html( $delivery_time_slot ) . '</p>';
    288252        }
    289     }
    290 
    291     /**
    292      * Display delivery fields on the classic thank you / order details page.
    293      *
    294      * @param string   $address_type Address type.
    295      * @param WC_Order $order        Order object.
    296      * @return void
    297      */
    298     public function delidaam_display_delivery_fields_order_confirmation( $address_type, $order ) {
    299         if ( 'billing' !== $address_type ) {
    300             return;
    301         }
    302 
    303         if ( $this->delidaam_has_rendered_confirmation_fields( $order ) ) {
    304             return;
    305         }
    306 
    307         // Blocks orders are rendered by WooCommerce itself (restyled via CSS); avoid a duplicate.
    308         if ( $this->delidaam_order_uses_blocks_additional_fields( $order ) ) {
    309             return;
    310         }
    311 
    312         $delivery_date      = $order->get_meta( self::DELIVERY_DATE_META_KEY );
    313         $delivery_time_slot = $order->get_meta( self::DELIVERY_TIME_SLOT_META_KEY );
    314 
    315         if ( '' === $delivery_date && '' === $delivery_time_slot ) {
    316             return;
    317         }
    318 
    319         self::$rendered_confirmation_orders[ $order->get_id() ] = true;
    320 
    321         $this->delidaam_render_delivery_table( $delivery_date, $delivery_time_slot );
    322253    }
    323254
    … …  
    426357    private function delidaam_render_delivery_table( $delivery_date, $delivery_time_slot ) {
    427358        $rows = [
    428             esc_html__( 'Delivery Date', 'delivery-date-time-slot-picker-for-woocommerce' )      => (string) $delivery_date,
    429             esc_html__( 'Delivery Time Slot', 'delivery-date-time-slot-picker-for-woocommerce' ) => (string) $delivery_time_slot,
     359            __( 'Delivery Date', 'delivery-date-time-slot-picker-for-woocommerce' )      => (string) $delivery_date,
     360            __( 'Delivery Time Slot', 'delivery-date-time-slot-picker-for-woocommerce' ) => (string) $delivery_time_slot,
    430361        ];
    431362
    … …  
    462393     */
    463394    private function delidaam_order_uses_blocks_additional_fields( $order ) {
    464         if ( ! class_exists( '\Automattic\WooCommerce\Blocks\Package' ) || ! class_exists( '\Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFields' ) ) {
    465             return false;
    466         }
    467 
    468         try {
    469             $checkout_fields = \Automattic\WooCommerce\Blocks\Package::container()->get(
    470                 \Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFields::class
    471             );
    472 
    473             $delivery_date = $checkout_fields->get_field_from_object( 'delidaam/delivery_date', $order, 'other' );
    474             $delivery_time_slot = $checkout_fields->get_field_from_object( 'delidaam/delivery_time_slot', $order, 'other' );
    475 
    476             return ( '' !== (string) $delivery_date || '' !== (string) $delivery_time_slot );
    477         } catch ( \Throwable $exception ) {
    478             return false;
    479         }
     395        // Block checkout stores "other" location fields as order meta prefixed with _wc_other/.
     396        return ( '' !== (string) $order->get_meta( '_wc_other/delidaam/delivery_date' ) || '' !== (string) $order->get_meta( '_wc_other/delidaam/delivery_time_slot' ) );
    480397    }
    481398
  • delivery-date-time-slot-picker-for-woocommerce/trunk/includes/class-delivery-settings.php

    r3720989 r3754237  
    2424                'id'   => 'delidaam_delivery_blackout_dates',
    2525                'desc' => __('Select blackout dates (you can select multiple).', 'delivery-date-time-slot-picker-for-woocommerce')
     26            ],
     27            [
     28                'name'    => __('Disabled Weekdays', 'delivery-date-time-slot-picker-for-woocommerce'),
     29                'type'    => 'multiselect',
     30                'id'      => 'delidaam_delivery_disabled_weekdays',
     31                'class'   => 'wc-enhanced-select',
     32                'default' => [],
     33                'options' => [
     34                    '1' => __('Monday', 'delivery-date-time-slot-picker-for-woocommerce'),
     35                    '2' => __('Tuesday', 'delivery-date-time-slot-picker-for-woocommerce'),
     36                    '3' => __('Wednesday', 'delivery-date-time-slot-picker-for-woocommerce'),
     37                    '4' => __('Thursday', 'delivery-date-time-slot-picker-for-woocommerce'),
     38                    '5' => __('Friday', 'delivery-date-time-slot-picker-for-woocommerce'),
     39                    '6' => __('Saturday', 'delivery-date-time-slot-picker-for-woocommerce'),
     40                    '7' => __('Sunday', 'delivery-date-time-slot-picker-for-woocommerce'),
     41                ],
     42                'desc'    => __('Days of the week on which delivery is not available. Leave empty to allow every day.', 'delivery-date-time-slot-picker-for-woocommerce'),
     43                'desc_tip' => true,
     44            ],
     45            [
     46                'name'    => __('Minimum Lead Time (days)', 'delivery-date-time-slot-picker-for-woocommerce'),
     47                'type'    => 'number',
     48                'id'      => 'delidaam_delivery_min_days',
     49                'default' => 0,
     50                'custom_attributes' => ['min' => 0, 'step' => 1],
     51                'desc'    => __('Earliest delivery date, counted in days from today. 0 allows same-day delivery, 2 means the earliest date is the day after tomorrow.', 'delivery-date-time-slot-picker-for-woocommerce'),
     52                'desc_tip' => true,
     53            ],
     54            [
     55                'name'    => __('Maximum Booking Window (days)', 'delivery-date-time-slot-picker-for-woocommerce'),
     56                'type'    => 'number',
     57                'id'      => 'delidaam_delivery_max_days',
     58                'default' => 0,
     59                'custom_attributes' => ['min' => 0, 'step' => 1],
     60                'desc'    => __('How many days ahead customers can book, counted from today. Leave 0 for no limit.', 'delivery-date-time-slot-picker-for-woocommerce'),
     61                'desc_tip' => true,
    2662            ],
    2763            [
    … …  
    66102});
    67103
     104// Sanitize disabled weekdays: only 1-7 (7 = Sunday; "0" would be dropped by WooCommerce's multiselect save), unique. Disabling all 7 days is ignored so checkout never has zero dates.
     105add_filter('woocommerce_admin_settings_sanitize_option_delidaam_delivery_disabled_weekdays', function ($value) {
     106    $days = [];
     107    foreach ((array) $value as $day) {
     108        if (is_numeric($day) && (int) $day >= 1 && (int) $day <= 7) {
     109            $days[(int) $day] = (string) (int) $day;
     110        }
     111    }
     112
     113    if (count($days) >= 7) {
     114        return [];
     115    }
     116
     117    return array_values($days);
     118});
     119
     120// Sanitize lead time: non-negative integer.
     121add_filter('woocommerce_admin_settings_sanitize_option_delidaam_delivery_min_days', function ($value) {
     122    return (string) absint($value);
     123});
     124
     125// Sanitize booking window: non-negative integer, never smaller than the lead time.
     126add_filter('woocommerce_admin_settings_sanitize_option_delidaam_delivery_max_days', function ($value) {
     127    $max = absint($value);
     128    // phpcs:ignore WordPress.Security.NonceVerification.Missing -- WooCommerce verifies the nonce before saving settings.
     129    $min = isset($_POST['delidaam_delivery_min_days']) ? absint(wp_unslash($_POST['delidaam_delivery_min_days'])) : (int) get_option('delidaam_delivery_min_days', 0);
     130
     131    if ($max > 0 && $max < $min) {
     132        $max = $min;
     133    }
     134
     135    return (string) $max;
     136});
     137
    68138// Sanitize the per-slot limit: non-negative integer.
    69139add_filter('woocommerce_admin_settings_sanitize_option_delidaam_delivery_slot_limit', function ($value) {
  • delivery-date-time-slot-picker-for-woocommerce/trunk/languages/delivery-date-time-slot-picker-for-woocommerce.pot

    r3648326 r3754237  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Delivery Date & Time Slot Picker for WooCommerce 1.5\n"
     5"Project-Id-Version: Delivery Date & Time Slot Picker for WooCommerce 1.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/delivery-date-time-slot-picker-for-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-08-15T10:43:46+02:00\n"
     12"POT-Creation-Date: 2026-10-19T12:37:16+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    4040msgstr ""
    4141
    42 #: delivery-date-time-slot-picker-for-woocommerce.php:37
    43 msgid "Delivery Date & Time Slot Picker Plugin requires WooCommerce to be installed and active."
    44 msgstr ""
    45 
    46 #: delivery-date-time-slot-picker-for-woocommerce.php:77
     42#: delivery-date-time-slot-picker-for-woocommerce.php:91
    4743msgid "Settings"
    4844msgstr ""
    4945
    50 #: includes/class-delidaam-blocks-compat.php:49
    51 #: includes/class-delidaam-blocks-compat.php:335
    52 #: includes/class-delivery-date-time-picker.php:79
    53 #: includes/class-delivery-date-time-picker.php:139
    54 #: includes/class-delivery-date-time-picker.php:273
    55 #: includes/class-delivery-date-time-picker.php:309
    56 #: includes/class-delivery-date-time-picker.php:342
    57 #: includes/class-delivery-date-time-picker.php:387
     46#: includes/class-delidaam-blocks-compat.php:48
     47#: includes/class-delidaam-blocks-compat.php:414
     48#: includes/class-delivery-date-time-picker.php:65
     49#: includes/class-delivery-date-time-picker.php:69
     50#: includes/class-delivery-date-time-picker.php:146
     51#: includes/class-delivery-date-time-picker.php:247
     52#: includes/class-delivery-date-time-picker.php:359
    5853msgid "Delivery Date"
    5954msgstr ""
    6055
    61 #: includes/class-delidaam-blocks-compat.php:58
    62 #: includes/class-delivery-date-time-picker.php:141
     56#: includes/class-delidaam-blocks-compat.php:57
     57#: includes/class-delivery-date-time-picker.php:148
    6358msgid "Select a delivery date"
    6459msgstr ""
    6560
    66 #: includes/class-delidaam-blocks-compat.php:66
    67 #: includes/class-delivery-date-time-picker.php:152
    68 #: includes/class-delivery-date-time-picker.php:277
    69 #: includes/class-delivery-date-time-picker.php:313
    70 #: includes/class-delivery-date-time-picker.php:346
    71 #: includes/class-delivery-date-time-picker.php:394
     61#: includes/class-delidaam-blocks-compat.php:65
     62#: includes/class-delivery-date-time-picker.php:159
     63#: includes/class-delivery-date-time-picker.php:251
     64#: includes/class-delivery-date-time-picker.php:360
    7265msgid "Delivery Time Slot"
    7366msgstr ""
    7467
    75 #: includes/class-delidaam-blocks-compat.php:72
    76 #: includes/class-delivery-date-time-picker.php:443
     68#: includes/class-delidaam-blocks-compat.php:71
     69#: includes/class-delivery-date-time-picker.php:410
    7770msgid "Select a time slot"
    7871msgstr ""
    7972
    80 #: includes/class-delidaam-blocks-compat.php:160
    81 #: includes/class-delivery-date-time-picker.php:173
     73#: includes/class-delidaam-blocks-compat.php:132
     74#: includes/class-delivery-date-time-picker.php:180
    8275msgid "Please select a delivery date."
    8376msgstr ""
    8477
     78#: includes/class-delidaam-blocks-compat.php:141
     79msgid "Please enter a valid delivery date."
     80msgstr ""
     81
     82#: includes/class-delidaam-blocks-compat.php:148
     83msgid "The selected delivery date has already passed. Please choose a different date."
     84msgstr ""
     85
     86#: includes/class-delidaam-blocks-compat.php:155
     87msgid "The selected delivery date is not available."
     88msgstr ""
     89
     90#: includes/class-delidaam-blocks-compat.php:162
     91msgid "Delivery is not available on the selected day of the week. Please choose a different date."
     92msgstr ""
     93
    8594#: includes/class-delidaam-blocks-compat.php:169
    86 msgid "Please enter a valid delivery date."
    87 msgstr ""
    88 
    89 #: includes/class-delidaam-blocks-compat.php:176
    90 msgid "The selected delivery date has already passed. Please choose a different date."
    91 msgstr ""
    92 
    93 #: includes/class-delidaam-blocks-compat.php:183
    94 msgid "The selected delivery date is not available."
    95 msgstr ""
    96 
    97 #: includes/class-delidaam-blocks-compat.php:208
    98 #: includes/class-delivery-date-time-picker.php:189
     95msgid "The selected delivery date is too soon. Please choose a later date."
     96msgstr ""
     97
     98#: includes/class-delidaam-blocks-compat.php:178
     99msgid "The selected delivery date is too far in the future. Please choose an earlier date."
     100msgstr ""
     101
     102#: includes/class-delidaam-blocks-compat.php:266
     103#: includes/class-delivery-date-time-picker.php:198
    99104msgid "The selected delivery time slot is fully booked for this date. Please choose another slot."
    100105msgstr ""
    101106
    102 #: includes/class-delidaam-blocks-compat.php:283
    103 #: includes/class-delivery-date-time-picker.php:187
     107#: includes/class-delidaam-blocks-compat.php:341
     108#: includes/class-delivery-date-time-picker.php:194
    104109msgid "Please select a delivery time slot."
    105110msgstr ""
    106111
     112#: includes/class-delidaam-blocks-compat.php:348
     113#: includes/class-delivery-date-time-picker.php:196
     114msgid "Please select a valid delivery time slot."
     115msgstr ""
     116
    107117#. translators: %s: date being removed from the blackout dates list.
    108 #: includes/class-delivery-date-time-picker.php:116
     118#: includes/class-delivery-date-time-picker.php:123
    109119#, php-format
    110120msgid "Remove %s"
    111121msgstr ""
    112122
    113 #: includes/class-delivery-date-time-picker.php:117
     123#: includes/class-delivery-date-time-picker.php:124
    114124msgid "Click to select blackout dates"
    115125msgstr ""
    116126
    117 #: includes/class-delivery-date-time-picker.php:134
    118 #: includes/class-delivery-date-time-picker.php:381
     127#: includes/class-delivery-date-time-picker.php:141
     128#: includes/class-delivery-date-time-picker.php:338
     129#: includes/class-delivery-date-time-picker.php:345
     130#: includes/class-delivery-date-time-picker.php:364
    119131msgid "Delivery Details"
    120132msgstr ""
    121133
    122 #: includes/class-delivery-date-time-picker.php:164
     134#: includes/class-delivery-date-time-picker.php:171
    123135msgid "Delivery details could not be verified. Please refresh and try again."
    124136msgstr ""
    … …  
    142154
    143155#: includes/class-delivery-settings.php:28
     156msgid "Disabled Weekdays"
     157msgstr ""
     158
     159#: includes/class-delivery-settings.php:34
     160msgid "Monday"
     161msgstr ""
     162
     163#: includes/class-delivery-settings.php:35
     164msgid "Tuesday"
     165msgstr ""
     166
     167#: includes/class-delivery-settings.php:36
     168msgid "Wednesday"
     169msgstr ""
     170
     171#: includes/class-delivery-settings.php:37
     172msgid "Thursday"
     173msgstr ""
     174
     175#: includes/class-delivery-settings.php:38
     176msgid "Friday"
     177msgstr ""
     178
     179#: includes/class-delivery-settings.php:39
     180msgid "Saturday"
     181msgstr ""
     182
     183#: includes/class-delivery-settings.php:40
     184msgid "Sunday"
     185msgstr ""
     186
     187#: includes/class-delivery-settings.php:42
     188msgid "Days of the week on which delivery is not available. Leave empty to allow every day."
     189msgstr ""
     190
     191#: includes/class-delivery-settings.php:46
     192msgid "Minimum Lead Time (days)"
     193msgstr ""
     194
     195#: includes/class-delivery-settings.php:51
     196msgid "Earliest delivery date, counted in days from today. 0 allows same-day delivery, 2 means the earliest date is the day after tomorrow."
     197msgstr ""
     198
     199#: includes/class-delivery-settings.php:55
     200msgid "Maximum Booking Window (days)"
     201msgstr ""
     202
     203#: includes/class-delivery-settings.php:60
     204msgid "How many days ahead customers can book, counted from today. Leave 0 for no limit."
     205msgstr ""
     206
     207#: includes/class-delivery-settings.php:64
    144208msgid "Max Orders per Time Slot"
    145209msgstr ""
    146210
    147 #: includes/class-delivery-settings.php:32
     211#: includes/class-delivery-settings.php:68
    148212msgid "Limit the number of deliveries allowed per slot per day."
    149213msgstr ""
    150214
    151 #: includes/class-delivery-settings.php:35
     215#: includes/class-delivery-settings.php:71
    152216msgid "Delivery Time Slots (one per line)"
    153217msgstr ""
    154218
    155 #: includes/class-delivery-settings.php:38
     219#: includes/class-delivery-settings.php:74
    156220msgid "Enter one time slot per line. Example: 10:00 AM - 12:00 PM"
    157221msgstr ""
  • delivery-date-time-slot-picker-for-woocommerce/trunk/readme.txt

    r3732053 r3754237  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.7
     7Stable tag: 1.8
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    2222* Add **multiple blackout dates** via calendar
    2323* Limit max orders per time slot
     24* **Disable weekdays** (e.g. no Sunday delivery), set a **minimum lead time** and a **maximum booking window**
    2425* Works with all WooCommerce shipping methods
    2526* **HPOS compatible** - works with WooCommerce High Performance Order Storage
    … …  
    4041Yes, use the "Blackout Dates" calendar in plugin settings.
    4142
     43= Can I turn off delivery on certain days of the week? =
     44Yes, choose them in "Disabled Weekdays" in plugin settings.
     45
     46= Can I require notice before delivery, or limit how far ahead customers book? =
     47Yes. "Minimum Lead Time" sets the earliest delivery date in days from today, and "Maximum Booking Window" sets the furthest date customers can pick.
     48
    4249= How can I define time slots? =
    4350Use the "Delivery Time Slots" field to define one time slot per line.
    … …  
    5158== Screenshots ==
    52591. Delivery date and time slot fields on Classic & Block-based checkout
    53 2. Admin settings for configuring blackout dates and slots
     602. Delivery Settings: blackout dates, disabled weekdays, lead time, booking window, slot limit and time slots
    54613. Delivery date and time slot shown on the WooCommerce admin order details screen
     624. Checkout calendar with disabled weekdays, blackout dates and lead time applied
     635. Delivery Date column on the WooCommerce Orders list
    5564
    5665== Changelog ==
     66
     67= 1.8 =
     68* Added: "Disabled Weekdays" setting to block delivery on chosen days of the week (e.g. Sundays)
     69* Added: "Minimum Lead Time" setting to set the earliest delivery date in days from today
     70* Added: "Maximum Booking Window" setting to limit how far ahead customers can book
     71* All three rules are enforced in the date picker and server-side on Classic and Block checkout
     72* Regenerated the translation (.pot) template with the new strings
    5773
    5874= 1.7 =
    … …  
    107123== Upgrade Notice ==
    108124
     125= 1.8 =
     126Adds Disabled Weekdays, Minimum Lead Time and Maximum Booking Window settings. All are off by default, so existing stores are unaffected. No breaking changes.
     127
    109128= 1.7 =
    110129Adds a Delivery Date column to the Orders list and unifies the delivery details design across Classic and Block order confirmation pages. No breaking changes.
  • delivery-date-time-slot-picker-for-woocommerce/trunk/uninstall.php

    r3720989 r3754237  
    1212delete_option( 'delidaam_delivery_blackout_dates' );
    1313delete_option( 'delidaam_delivery_slot_limit' );
     14delete_option( 'delidaam_delivery_disabled_weekdays' );
     15delete_option( 'delidaam_delivery_min_days' );
     16delete_option( 'delidaam_delivery_max_days' );
    1417delete_option( 'delidaam_delivery_time_slots' );
Note: See TracChangeset for help on using the changeset viewer.