=== SPP Native Core SKU Search ===
Contributors: spp
Tags: woocommerce, sku, search, product search, ecommerce
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Extend WordPress storefront search to match WooCommerce product SKUs from the _sku metadata field.

== Description ==

By default, WordPress search only scans post titles and content. WooCommerce stores product SKUs in post meta (`_sku`), so customers who search by part number often get zero results even when the product exists.

**SPP Native Core SKU Search** hooks into WordPress core search SQL via the `posts_search` filter and OR-merges matching product IDs found in the `_sku` metadata field. No external search service is required.

= Features =

* Storefront SKU search using native WordPress query hooks
* Optional admin search support
* Partial or exact SKU matching
* Variation SKU matching with parent product results
* Configurable minimum search term length
* WooCommerce HPOS compatibility declaration

= Requirements =

* WordPress 6.0+
* WooCommerce 5.0+ (for SKU metadata)

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen.
3. Open **WooCommerce → SKU Search** to review settings.
4. Search for a known product SKU on your storefront.

== Frequently Asked Questions ==

= Does this replace my theme search? =

No. The plugin extends the existing WordPress search query so SKU matches are included alongside title and content matches.

= Will variation SKUs appear as separate results? =

When variation SKU matching is enabled, the parent product is returned instead of the variation post.

= Does this work with WooCommerce blocks search? =

Yes, for block-based product searches that use `WP_Query` with the `s` parameter and `product` post type.

== Screenshots ==

1. SKU Search settings under WooCommerce.

== Changelog ==

= 1.0.0 =
* Initial release.
* `posts_search` integration for `_sku` metadata matching.
* Admin settings page with storefront, admin, exact match, and variation options.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
