WooCommerce Bookings Repair Tool
A repair tool for fixing common issues with WooCommerce Bookings, including missing buffer period fields and corrupted booking data.
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/shameemreza/wc-bookings-repair/archive/refs/heads/main.zipReadme
WooCommerce Bookings Repair Tool
A mini extension to fix common issues with WooCommerce Bookings, including missing buffer period fields and corrupted booking data.
It helps solve common issues with the WooCommerce Bookings extension, particularly problems that can occur when upgrading or when products were created before installing the Bookings plugin.
Main Features
- Fix missing buffer period fields in bookable products.
- Repair product metadata for proper functioning.
- Fix corrupted bookings with missing product IDs.
- Clean up transients that might be causing display issues.
- Diagnose product type issues.
When to use this tool
This tool is particularly useful when:
- You have bookable products that are missing certain fields (like buffer period settings).
- Products were created before installing WooCommerce Bookings.
- You've upgraded from an older version and some features aren't working.
- You're seeing errors in bookings functionality.
Common issues this plugin fixes
Missing Buffer Period Settings
One of the most common issues this plugin addresses is missing buffer period settings in bookable products. This typically happens when:
- Products were created before the WooCommerce Bookings plugin was installed.
- Products were initially set up as a different product type and later converted to a bookable product.
- There is a conflict between WooCommerce Bookings and WooCommerce Accommodations Bookings.
The buffer period setting allows merchants to require a gap between bookings (for cleaning, preparation, etc.), but when product metadata is incomplete, this field doesn't appear in the admin interface even though the product is set as "bookable".
Accommodation Bookings Conflicts
If you're using both WooCommerce Bookings and WooCommerce Accommodation Bookings, you might encounter issues where:
- Buffer period fields disappear from regular bookable products.
- Converting between accommodation bookings and regular bookings causes missing UI elements.
- The product type reverts to a different type after saving.
This happens because the Accommodation Bookings extension modifies how product types are handled and sometimes overwrites the buffer field templates from the main Bookings plugin.
Technical Details
From a technical perspective, the plugin addresses these issues by:
- Ensuring complete metadata: Products created before installing Bookings often lack required meta fields
- Forcing field visibility: Using CSS and JavaScript to override any code that might be hiding the buffer fields
- Fixing product type taxonomy terms: Ensuring the product is properly tagged in the database
- Cleaning up transients: Removing cached data that might contain outdated product information
- Handling Accommodation Bookings conflicts: Adding buffer fields to both regular and accommodation bookings products
Installation
- Download the plugin zip file
- Upload the
wc-bookings-repairfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to WooCommerce > Bookings > Repair Bookings to access the repair tools
Usage
The plugin adds a "Repair Bookings" menu item under the WooCommerce Bookings menu. From this page, you can:
- Diagnose Product Types: Examine your products to identify issues with product types and meta fields
- Fix Bookable Products Meta: Ensure all required meta fields exist for bookable products
- Force Add Buffer Fields: Forcibly add the buffer period field to all bookable products
- Repair Corrupted Bookings: Fix bookings with missing product IDs or other essential data
- Clean Up Transients: Remove cached data that might be causing display issues
Additionally, when editing a product, if buffer fields are missing, the plugin will add a notice at the top of the product edit page with a "Fix Booking Product Type" button that can fix the specific product.
FAQs
Does this plugin modify my bookings data?
The plugin only adds missing metadata and fixes corrupted bookings. It doesn't remove any existing booking data.
Will this affect existing bookings?
No, existing bookings will not be affected. The plugin only repairs missing data and ensures all fields display correctly.
Can I use this with Accommodation Bookings?
Yes, the plugin can help fix issues with both regular bookings and accommodation bookings. It's specifically designed to handle conflicts between the two plugins.
What if I have other WooCommerce Bookings extensions?
The plugin is designed to work alongside other WooCommerce Bookings extensions without causing conflicts.
What causes buffer fields to disappear?
Buffer fields can disappear due to several reasons:
- Incomplete product metadata when converting to a bookable product
- JavaScript that conditionally shows/hides fields based on other settings
- Conflicts between WooCommerce Bookings and the Accommodation Bookings extension
- Product type being incorrectly set in the database despite showing as "Bookable" in the UI
Requirements
- WordPress 6.0+
- WooCommerce 7.0+
- WooCommerce Bookings 1.15+
- PHP 7.4+
Changelog
1.0.0
- Initial release
License
This plugin is licensed under the GPL v2 or later.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.