=== SalePilot for WooCommerce ===
Contributors: eveningdesk
Tags: woocommerce, bulk edit, sale price, discount, bulk price
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Bulk sale-price campaigns for WooCommerce. Preview every new price before anything changes, then roll the whole campaign back in one click.

== Description ==

SalePilot puts a whole catalogue on sale without editing products one by one, and without the usual worry of a bulk edit: nothing is written until you have seen every price it will produce, and everything it writes can be undone exactly.

**How a campaign works**

1. Choose the products: the whole store, or a selection by product, category, tag and product type.
2. Choose the change: a percentage or a fixed amount off, written to the sale price (the usual choice, so the storefront shows the struck-through original) or to the regular price.
3. Choose the rounding: none, whole numbers, or prices ending in .99.
4. Preview. Every affected product and variation is listed with its current price, its new price and the effective discount, along with totals, warnings and anything that will be skipped. Exclude any row you do not want touched.
5. Apply. SalePilot snapshots every current price, then writes the new ones in the background, so a large catalogue neither times out nor needs the browser tab left open.
6. Roll back at any time from History. Each item returns to the exact price it had before, and items that someone edited by hand since the campaign ran are flagged instead of being silently overwritten.

**Built to be safe on a live store**

* Preview and apply share one calculation, so what you preview is what gets written.
* Safety limits stop runaway discounts, prices below a minimum and sale prices at or above the regular price.
* Variable products are priced per variation, never on the parent.
* Existing orders are never touched. Grouped, external and subscription products are never modified.
* Background batches are small and self-healing: a batch that dies mid-run is picked up again automatically.
* Full audit history of every campaign, what it changed and what it skipped.

**Multilingual and multi-currency stores**

With WPML and WooCommerce Multilingual, SalePilot changes original-language products only and lets WooCommerce Multilingual carry the price to translations, so nothing is discounted twice. With WCML multi-currency, it changes the base currency and leaves custom secondary-currency prices alone.

**SalePilot Pro**

[SalePilot Pro](https://eveningdesk.cloud/salepilot) adds:

* Scheduled sales that start and end on their own.
* Price increases, exact prices and clearing sale prices.
* Individual discounts and rounding for single products and variations, plus bulk quick discounts from the preview table.
* Every rounding rule: .95, .90, .49, nearest 0.05 / 0.10 / 0.50, custom endings and steps, rounding up or down.
* More ways to treat products already on sale: build on the current sale price, or keep whichever price is lower or higher.
* Filters by stock status, sale status, price range, product name, SKU and product ID.
* Edit a campaign after it has run: change its products, discount, rounding or dates, preview exactly what changes, and apply only the differences. Products taken out get back the price they had before.
* Adjustable safety limits and history retention.
* CSV export of any campaign.

== Installation ==

1. Install and activate WooCommerce 7.0 or newer.
2. Install SalePilot from Plugins > Add New, or upload the plugin folder to `/wp-content/plugins/`, and activate it.
3. Open WooCommerce > SalePilot and create your first price update.

SalePilot runs its background work through Action Scheduler, which ships with WooCommerce. The Diagnostics tab checks that the queue is working.

== Frequently Asked Questions ==

= Does SalePilot change anything before I click Apply? =

No. The form and the preview only read prices. Product prices change when you apply the campaign, and not before.

= How does rollback work? =

Before a campaign writes anything, SalePilot records every price it is about to change. Rolling back restores those exact values. If a product was edited after the campaign ran, it is reported as a conflict and left as it is, unless you choose to force the rollback.

= What happens to products that are already on sale? =

You choose per campaign: replace the existing sale price with one calculated from the regular price (recommended), or skip those products. The existing sale price is kept in the rollback snapshot either way.

= My store has thousands of products. Will this time out? =

No. The preview loads page by page, and applying a campaign runs in small background batches through Action Scheduler. You can close the page while it runs and follow progress on the Campaigns tab.

= Does it work with HPOS and the product block editor? =

Yes. SalePilot never reads or writes order data, and it declares compatibility with both.

= What happens to my data if I uninstall? =

Campaign history and rollback snapshots are kept unless you tick "Delete all SalePilot data when the plugin is uninstalled" in Settings, so reinstalling brings back your history and the ability to roll back.

= Does SalePilot send data anywhere? =

No. The free plugin makes no external requests.

== Screenshots ==

1. Describe the campaign: which products, what change, which rounding rule.
2. The preview: every product and variation with its current price, new price and effective discount, before anything is written.
3. A completed campaign: every item before and after, with one-click rollback.
4. History of every campaign and rollback.

== Changelog ==

= 1.5.2 =
* New plugin icon.

= 1.5.1 =
* Passes the WordPress Plugin Check with no errors or warnings.
* Translator notes added to every string with a placeholder.
* Removed a leftover diagnostic that queried the background queue on every clean-up pass.
* The free edition leaves loading its translations to WordPress.

= 1.5.0 =
* Pro: edit a campaign after it has run. Change its products, discount, rounding or dates in the usual form, see in the preview what changes for each product, and apply only the differences. Products taken out get back the price they had before the campaign, and rolling back still restores every price from before it.
* Pro: this replaces the separate "add products" box and "remove selected" button from 1.4.0.
* A draft can be reopened in the form with "Change settings" before it is applied.
* Database updates now also run before background work, not only when an admin page is opened.

= 1.4.0 =
* Pro: add products to a campaign that has already run, or take products out of it. Added products get the campaign's rule and are written right away. Removed products get back the price they had before.
* Fix: recovering a stalled campaign could stop with a PHP error instead of restarting its batches.
* Fix: a failure while preparing a campaign is now caught and handed to the background queue, as intended.

= 1.3.0 =
* First public release.
