WP Manifestindependent plugin directory
manifest / ecommerce / yith-wcbk-minimum-duration-dates

Minimum/maximum booking duration based on dates

Set dynamic minimum night rules for WooCommerce bookings depending on specific dates or seasons.

by jpagano · github.com/jpagano/yith-wcbk-minimum-duration-dates · website

0stars
0forks

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/jpagano/yith-wcbk-minimum-duration-dates/archive/refs/heads/main.zip

Readme

Minimum/maximum booking duration based on dates

Set dynamic minimum night rules for WooCommerce bookings depending on specific dates or seasons.


Description

This plugin extends YITH WooCommerce Booking Premium by allowing you to define date-based minimum stay rules for bookable products. You can set different minimum night durations based on custom periods (e.g., holidays, high season, weekends) using both fixed and dynamic dates (like Easter or Palm Sunday).

Features

  • Add custom rules with start/end dates and required minimum nights for each bookable product.
  • Use fixed dates (e.g., 2025-08-01) or dynamic dates like easter+1, easter-2, or Palm Sunday.
  • Drag-and-drop to reorder rules for priority.
  • Special buttons in the admin UI to quickly select dynamic dates (Easter, Palm Sunday).
  • Calendar datepicker for easy date selection.
  • If no rule matches, the product's default minimum nights value is used.
  • Seamless integration into the WooCommerce product editing screen ("Minimum nights" tab).
  • Built following WordPress coding standards and best practices.
  • Fully translatable and localized.

Requires the YITH WooCommerce Booking Premium plugin.


Installation

  1. Upload the plugin folder to /wp-content/plugins/yith-wcbk-minimum-duration-dates, or clone the repository.
  2. Activate the plugin through the 'Plugins' screen in WordPress.
  3. Edit any bookable WooCommerce product and open the Minimum nights tab to configure rules.

Usage

  1. Go to Products > All Products and edit a bookable product.
  2. In the product data panel, open the Minimum nights tab.
  3. Add rules by specifying:
    • Rule name (optional, for your reference)
    • Start date and End date (use the calendar or dynamic date buttons)
    • Minimum nights required for bookings in that period
    • Activate/deactivate rules as needed
  4. Drag and drop rules to set their priority (top rules are checked first).
  5. Save the product. The rules will be enforced on the booking form.

If no rule matches the selected dates, the default minimum nights for the product will apply.


Frequently Asked Questions

Does this plugin work without YITH WooCommerce Booking?

No. It only works if YITH WooCommerce Booking Premium is installed and active.

Can I set different rules for different products?

Yes. Each bookable product can have its own custom set of rules and a default minimum stay value.

What happens if the selected dates don't match any rule?

The plugin will fall back to the default minimum nights value defined for that product.

Can I use dynamic dates like Easter or Palm Sunday?

Yes. Use the special buttons in the rule editor to insert dynamic dates (e.g., easter, easter+1, easter-2, or Palm Sunday). These adjust automatically each year.

Is the plugin translatable?

Yes, all strings are ready for translation and .pot/.po files are included.


Changelog

1.0.0

  • Initial release.
  • Adds product-level UI to define date-based minimum stay rules.
  • Supports fixed and relative date formats (e.g., Easter offsets).
  • Drag-and-drop rule sorting and dynamic date buttons in admin UI.

License

This plugin is licensed under the GPLv2 or later.
See https://www.gnu.org/licenses/gpl-2.0.html for full license terms.

Read the full README on GitHub →