=== Shop Search for WooCommerce ===
Contributors: forge12
Tags: search, woocommerce, product search, autocomplete, live search
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.48.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Shop search for WooCommerce and WordPress: live suggestions, SKU search, “Did you mean”, sections and insights. No cloud, no external calls.

== Description ==

The built-in WordPress search finds a title when it is typed exactly as
written. It does not find the SKU, the category, or the word with a typo.
Shop Search for WooCommerce turns it into a shop search that understands what your
customers mean – and shows you what they did not find.

Everything runs in your own WordPress database. The plugin contacts no
external service.

**At a glance**

* Live suggestions with image, price and stock status – from two characters on
* Finds SKUs, categories and tags, ranked by relevance
* “Did you mean …?” checked against the real number of results
* Results page with tabs per section, sorting and an empty state that helps
* Search log with the searches that found nothing – your shopping list of
  missing products and words
* Blocks, Elementor widgets, shortcodes and filter hooks
* No cloud, no tracking, no external requests

Need synonyms, automatic typo correction, filters or rules per search term?
They are part of the separate plugin
[F12 Shop Search Pro](https://www.forge12.com/en/shop/woocommerce-product-search/?utm_source=wporg-free&utm_medium=readme&utm_campaign=top)
– see “Free and Pro” below.

**As you type**

* **Suggestion list** from two characters on: word completions and the
  matching products with image, price, “Sale” and “Out of stock”, plus the
  SKU when it was what matched.
* **Popular products** on the first click into an empty search field
  (optional).
* Width, corner radius and colors of the list are adjustable, with a live
  preview.
* Cached and rate-limited, so a script hammering the endpoint does not slow
  down your shop.

**What is found**

* **SKUs**, including those of variations – the product is found.
* **Categories and tags** as search text; matching categories as cards above
  the results.
* **Relevance:** a full title match ranks before an SKU, before a category,
  before body text.
* **“Did you mean …?”** for typos, checked against the actual number of
  results – no guessing.

**On the results page**

* **Tabs per section** (All · Products · Posts · Pages …) with result counts;
  “All” as a grouped overview. Sections combine any content types.
* **Sorting**, unit price, pack sizes and badges on the product card.
* **Empty state** with tips and categories instead of a dead end.
* The plugin's own results page, your theme's, or a page you design
  yourself, with any theme – tested with Twenty Twenty-Five and Twenty
  Twenty-One.

**Insights**

* **Search log** in your own database: frequent searches and searches without
  results for the last 7, 30 or 90 days – the list that tells you which
  products or words your shop is missing.

**Fits in**

* **Blocks** for the block editor, **Elementor widgets** and shortcodes.
* Every setting is also available as a **filter hook** – for developers. A
  filter always wins over the setting; the hook name is shown next to each
  field.

**Free and Pro**

This plugin is complete on its own. For shops with a large range, many
spellings of the same product, or a team that tunes the search every week,
[F12 Shop Search Pro](https://www.forge12.com/en/shop/woocommerce-product-search/?utm_source=wporg-free&utm_medium=readme&utm_campaign=comparison)
is a separate plugin from Forge12 that adds:

* **Synonyms with a visual editor** – connect terms, categories and products
  with a line, so “wholemeal” finds the “whole grain flour”. Simulate the
  search first; get suggestions from real searches.
* **Typos corrected automatically** – “Dinkl” shows the results for “Dinkel”
  right away, with a way back to the typed word.
* **Word forms and compound words** – “pans” finds “pan”,
  “wholegrainflour” finds “whole-grain flour”; only words from your own range,
  nothing guessed.
* **Filters on the results page** – category, price (steps or slider),
  availability and any WooCommerce attribute, with the number of results at
  every value; without reloading the page, as a panel on phones.
* **Rules per search term** – pin a product to the top, hide results, or send
  a search straight to a page.
* **Custom fields** (also ACF) searched along.
* **Click rate per term** and “searched but rarely clicked”, with a button
  that creates the rule right there.
* **Search templates** – carry the look of field, suggestion list, results
  page and filters over to the next site.
* **Avada** Post Cards, icon sets and the search field in the header;
  **WPML** and **Polylang**.
* **Fast path** for suggestions, delivered without loading plugins and theme.

[See the comparison and Pro on forge12.com](https://www.forge12.com/en/shop/woocommerce-product-search/?utm_source=wporg-free&utm_medium=readme&utm_campaign=more)

== Installation ==

1. Install the plugin from the plugin directory (or upload the ZIP) and
   activate it.
2. Under **Search → Results page**, choose who renders the results page: the
   plugin template, your theme, or a page you design yourself.
3. Optional: define sections under **Search → Sections**, and check the
   suggestion list under **Search → Suggestion list**.

Help for every page is built in under **Search → Help**.

== Frequently Asked Questions ==

= Does it need WooCommerce? =

No. Without WooCommerce, prices, unit prices and product badges simply do not
appear; searching posts and pages works as before.

= Does it send data anywhere? =

No. Search, suggestions and insights run in your WordPress database. The
plugin makes no requests to external servers, and the admin pages load no
external fonts or scripts. The links to forge12.com (support, feedback)
are plain links.

= What is the difference between this plugin and Pro? =

Everything listed above works in this plugin without limits, forever. F12 Shop
Search Pro is a separate plugin with additional functions: synonyms, automatic
typo correction, word forms, filters on the results page, rules per search
term, custom fields, click rates, search templates and the Avada, WPML and
Polylang integrations. Details on
[forge12.com](https://www.forge12.com/en/shop/woocommerce-product-search/?utm_source=wporg-free&utm_medium=readme&utm_campaign=faq).

= What does the search log store? =

The search term, the section, filter and sort order, the number of results,
the device type (desktop, tablet, phone) and the time – no IP address, no user
ID, no cookies. Searches by administrators and by bots are not logged. The log
is **off after activation**: nothing is stored until you turn it on under
**Search → Insights**. Once on, it keeps entries for 90 days by default. The plugin suggests a paragraph for
your privacy policy under Settings → Privacy.

= What is “Report search terms to analytics”? =

If your site already runs Matomo, the plugin can pass each site search (term,
section, number of results) to Matomo's site-search report, in the visitor's
browser. It is **off by default**: nothing is passed on until you turn it on
under **Search → Insights**. It adds no tracking of its own; without a Matomo
snippet on your site nothing is sent either way.

= Can I adapt the results template? =

Yes: a file `f12shopsearch/search.php` in your (child) theme replaces it, or use
the filter `f12shopsearch/results_page/template`.

== Screenshots ==

1. The suggestion list as you type – completions and products with image and price.
2. The results page with tabs per section, category cards and sorting.
3. Overview: what the search did in the last days and what would help now.
4. Insights: frequent searches and searches without results.
5. Settings for the suggestion list, with live preview.
6. Type a SKU – the suggestion list finds the product by its article number.
7. A typo: “Did you mean …?” points to the word that has results.
8. “All” as a grouped overview with matching categories and a section for every content type.

== Source code and third-party software ==

The settings screen is a React application. Its readable source code is in the
`src/` folder of the plugin; `build/index.js` is generated from it. To rebuild:
`npm install && npm run build` (Node.js 18 or later; the help chapters in
`hilfe/` are turned into `src/hilfe/inhalt.generated.js` by
`tools/hilfe-bauen.mjs`).

Bundled with the plugin:

* Inter variable font (`build/fonts/`) – SIL Open Font License 1.1,
  https://openfontlicense.org
* lucide-react icons – ISC license
* react-router – MIT license
* WordPress packages (`@wordpress/components`, `element`, `i18n`, `api-fetch`) –
  GPL-2.0-or-later

The plugin's own code is licensed under GPL-2.0-or-later.

== Changelog ==

= 1.48.1 =
* The plugin is now called "Shop Search for WooCommerce". The readme shows what the separate Pro plugin adds.

= 1.48.0 =
* Products with a "not sold individually" notice are now listed after all other results and suggestions, in every sort order.

= 1.47.0 =
* Internal changes only; no new features in this version.

= 1.46.1 =
* Internal changes only; no new features in this version.

= 1.46.0 =
* Internal changes only; no new features in this version.

= 1.45.0 =
* Internal changes only; no new features in this version.

= 1.44.0 =
* First release in the WordPress plugin directory.
