=== Pre-Orders for WooCommerce – PreCart ===
Contributors: tasin07
Requires at least: 5.0
Tags: preorder, pre order, backorder, preorder plugin, woocommerce pre order, out of stock, coming soon, product preorder, woocommerce backorder, preorder woocommerce
Requires PHP: 7.4
WC tested up to: 10.8
Tested up to: 7.0
WC requires at least: 6.0
Stable tag: 0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Easily enable **preorders** for your WooCommerce store. The best free WooCommerce preorder plugin — let customers pre-order out-of-stock, upcoming, and backorder products before they launch. Set release dates, auto-enable preorder when stock hits zero, accept payments, and manage everything from your dashboard.

== Description ==

Looking for a simple, powerful **WooCommerce preorder plugin**? **Pre-Orders for WooCommerce – PreCart** is the easiest way to let customers **pre-order products** before they're available. Whether launching new items, restocking popular ones, or selling out-of-stock products with automatic backorder support, this plugin helps you capture sales you'd otherwise miss.

With this free preorder plugin for WooCommerce, customers can place pre-orders for upcoming, out-of-stock, or limited-edition products directly on your site. Gain early insights into demand, improve inventory planning, and secure revenue in advance.

👉 **Perfect for:**
- Product launches & crowdfunded items
- Out-of-stock products with **automatic backorder**
- Limited-time offers & seasonal inventory
- Digital content, books, music, and more

💡 Give your customers the power to **pre-order WooCommerce products** confidently — and deliver a premium shopping experience with automatic email updates and customizable preorder settings.

[📘 Full Documentation](https://precart.helpspace-docs.io/category/9/getting-started)

### Why PreCart is the best free WooCommerce Pre-Order plugin

Unlike paid alternatives that charge a monthly fee, PreCart gives you everything you need to run preorders on your WooCommerce store for **free**:

- **Stock-based preorder** — products automatically become available for preorder when they go out of stock (new in 0.7)
- **Global or per-product** — enable preorder for everything at once, or pick individual products
- **Preorder limits** — cap how many customers can preorder per product
- **Custom status** — preorders get a dedicated order status so you can filter and manage them

== 🔑 Key Features ==

🛒 **WooCommerce Preorder for Any Product**
Enable preorder on simple or variable products with one click. Works with your existing inventory.

📅 **Set Custom Release Dates**
Control when products ship with per-product or global availability dates. Customers see the date clearly on the product page.

📦 **Stock-Based Preorder & Backorder (NEW in 0.7)**
When a product runs out of stock, it automatically becomes available for preorder — with an optional backorder limit. No manual toggling needed.

💰 **Flexible Payment Options**
Charge upfront at checkout. Collect revenue before products are even released.

📨 **Email Notifications**
Customers automatically receive confirmation emails when they place a preorder.

🎨 **Customizable Button & Message**
Change the add-to-cart text, badge, and preorder message to match your brand. Use `{precart_release_date}` to show the ship date dynamically.

🚫 **Preorder Quantity Limits**
Set a maximum number of preorders per product. Prevents overselling before release.

🔄 **Cart Mode Control**
Choose whether customers can mix preorder and regular items in the same cart or require separate orders.

🏷️ **Dedicated Preorder Order Status**
Preorders get a custom status so you can filter, manage, and fulfill them separately from regular orders.

== 🚀 Why Use This WooCommerce Preorder Plugin? ==

Pre-orders are common for video games, smartphones, book launches, music/album releases, crowdfunded products, limited-edition products, and many more niches. Companies use them to gauge demand and secure early sales.

### 📈 Boost Sales
Never miss out on orders for out-of-stock or not-yet-released items. With the new **automatic backorder** feature, you keep selling even when inventory hits zero.

### 🔥 Build Hype Before Launch
Generate excitement with preorder options for exclusive or trending products. Show a countdown and release date to create urgency.

### 📊 Forecast Demand
Use preorder data to plan inventory, reduce waste, and align with manufacturing timelines.

### 💬 Improve Customer Experience
Give customers transparency with clear preorder messaging, release dates, and automatic updates.

== Frequently Asked Questions ==

= How do I enable pre-orders for a product? =
Navigate to your product edit screen in WooCommerce, click the **Pre-Order** tab in the Product Data section, check "Enable Pre-Order", then set a release date. You can also enable preorder for all products from **PreCart > Settings**.

= What is stock-based preorder / backorder? =
Stock-based preorder (new in version 0.7) automatically turns on preorder mode when a product runs out of stock. You can set this per-product or globally. No need to manually check a box — it just works. You can also set a backorder limit to control how many preorders are accepted while out of stock.

= Can I set a limit on how many preorders are accepted? =
Yes! You can set a **Pre-Order Limit** per product for date-based preorders, and a separate **Backorder Limit** for stock-based preorders. Set to 0 for unlimited.

= Does this work with out-of-stock products? =
Yes. With the stock-based preorder feature (0.7+), out-of-stock products automatically become available for preorder. The "Pre-Order Now" button replaces the "Out of Stock" message, and customers can checkout normally.

= Can I collect payments for pre-orders immediately? =
Yes, you can collect payments for pre-orders immediately. A 'pay later' option is planned for a future version.

= Does this work with my theme or other plugins? =
Compatible with all WooCommerce-supported themes and most payment gateways. Not compatible with block-based cart/checkout (classic cart/checkout is fully supported).

= How are pre-orders tracked in inventory? =
Pre-orders are tracked with separate counters from regular stock. Date-based preorders use `_precart_pre_order_count`, and stock-based backorders use `_precart_backorder_count`.

= Can I enable preorder for all products at once? =
Yes. Go to **PreCart > Settings > General Settings** and toggle "Enable Pre-Order" on, then set a global release date.

= What happens when an order is cancelled? =
Preorder and backorder counts are automatically decremented when an order is cancelled or refunded, so your limits always reflect actual pending demand.

== Installation ==

1. Upload the `precart` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **PreCart > Settings** to configure the plugin.
4. Enable pre-orders for individual products from the product edit page.

== Screenshots ==

1. Pre-Order tab in the WooCommerce product editor — enable preorder, set release date, and configure stock-based triggers.
2. PreCart Settings page — configure global preorder, cart mode, and stock trigger options.
3. Product page with preorder badge, message, and "Pre-Order Now" button.

== Changelog ==

= 0.7 =

**Release Date:** 2026-06-17

* **NEW: Stock-Based Preorder / Backorder** — products automatically enter preorder mode when they go out of stock. No manual toggling needed.
* **NEW:** Per-product "Enable Stock-Based Pre-Order" checkbox and "Backorder Limit" field in the product data tab.
* **NEW:** Global stock trigger setting with configurable out-of-stock preorder message (PreCart > Settings > Stock Trigger).
* **NEW:** Distinct amber badge style (`.wcpo-pre-order-badge--stock`) to visually separate stock-triggered preorders from date-based ones.
* **NEW:** Custom `wc-precart` order status is now editable in the admin — change items, recalculate totals, and apply actions.
* **IMPROVED:** `{precart_release_date}` token in stock messages shows "TBD" when no release date is set.
* **FIXED:** Preorder counters could double-increment on thank-you page reloads — idempotency guard added.
* **FIXED:** Duplicated eligibility logic across Product, Cart, and Validation consolidated into a single `Helper::is_preorder_product()` method.
* **FIXED:** Preorder/backorder counts now decrement when an order is cancelled or refunded.
* **NEW:** Admin review prompt with modern card-style design, shown on PreCart pages after 5 days of installation.
* **NEW:** Dedicated settings-page review notice with a "Leave Review" button only (no dismiss controls) above the PreCart Settings page.
* **FIXED:** Global preorder mode now correctly displays the global release date instead of the per-product date when the per-product preorder is not enabled.
* **FIXED:** Product list page "Pre-Order Now" button now also renders for out-of-stock products when stock-based preorder is active.
* **FIXED:** Infinite recursion / memory-exhaustion bug in `woocommerce_product_is_in_stock` filter — now uses raw `get_stock_status()` to avoid the loop.
* **IMPROVED:** Helpspace support widget link replaced with direct WordPress.org support forum link in admin settings.


= 0.6 =

**Release Date:** 2026-06-09

* **FIXED:** Fatal error "Call to member function get_id() on null" when product page contained WooCommerce shortcodes without a valid product context.
* **FIXED:** Invalid release date display when switching between per-product and global preorder modes.
* **IMPROVED:** Internal code cleanup and WooCommerce HPOS compatibility hardening.

= 0.5 =

**Release Date:** 2026-05-31

* **FIXED:** Incorrect date displayed when the global pre-order option was enabled.
* **FIXED:** Setting **Pre-Order Product Limit** to `0` prevented products from being added to the cart. Value of `0` now means **unlimited**.
* **ADDED:** Support for WooCommerce 10.8.
* **UPDATED:** Tested up to WordPress 6.9.

= 0.4 =

Release date: 2025-11-11

* Fixed: preorder product showing error on `Add To cart`

= 0.3 =

Release date: 2025-06-01

* Fixed issue where button text would not update correctly.
* Fixed text domain error notice.

= 0.2 =

Release date: 12-03-25

* Added: New fields in Settings
* Added: Set global preorder for all products
* Added: Prevent customers to order pre order and regular products at once
* Fixed: cart-key error showing in the cart page

= 0.1 =
* First release
