=== TINXDK Search Lite ===
Contributors: tinxdk
Tags: search, live search, ajax search, woocommerce search, product search
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 8.2.35
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

One fast live search for products, categories, pages and posts, grouped under headings, with prices as WooCommerce shows them.

== Description ==

TINXDK Search Lite gives your site one elegant search field with a dropdown that finds products, product categories, pages, posts and custom post types at once and shows them grouped under headings (for example "Categories" with image and title, "Products" with thumbnail, title and price, and a "See all (18)" link to the results page). It is built for shops where the product data comes from a product information system (PIM) and is synchronised to WooCommerce, but works on any WordPress site.

**Features**

* Pill-shaped search field with magnifier and clear button; live results below it with debounce and a minimum number of characters.
* Sources: posts, pages, WooCommerce products, optional custom post types, and taxonomies (product categories, tags, post categories). Searches title, excerpt and content, and for products also SKU and EAN/GTIN (also the SKU of variations).
* Simple relevance (title before excerpt before content), AND/OR logic, sorting by relevance, title or date, exclusion by post ID, limits per group.
* Grouped result list with configurable group names, image (featured image, first image in the content or a default image), excerpt, date or price, and highlighted search words.
* WooCommerce prices follow the shop's tax settings, for example "293,00 kr. ekskl. moms (366,25 kr. inkl. moms)".
* Autocomplete suggestions from titles, categories and tags, "See all" link, optional "Show more" button, Enter/magnifier action (results page, first result or live only), open in a new tab.
* Keyboard navigation and ARIA (combobox and listbox); on small screens the results open full screen with a close button and the page behind does not scroll.
* Five base themes (light pill, dark, minimal, high contrast, warm), colours, border radius and font size through CSS variables, your own CSS, and a live preview on the settings page. No external fonts, no jQuery.
* Use it as a shortcode `[tinxdk_search]`, as a block ("TINXDK Søg"), or let it replace the theme's search form and the WooCommerce product search.
* Optional override of the WordPress search results page, so the "See all" page searches the same sources, with a filter per content type.
* Only published, visible content is ever returned: no drafts, private posts or password-protected posts, and products hidden from search stay hidden.
* The REST endpoint `/wp-json/tinxdk-search/v1/search` is public and read-only. There is no form submission, so no captcha is needed.
* The interface is in Danish (translation files for da_DK are included; WordPress.org language packs are used when available).

This Lite plugin has one search instance. The separate add-on [TINXDK Search Pro](https://tinxdkcloud.dk/wordpress-plugins/tinxdk-search/#pro) (licence from tinxdkcloud.dk, not part of this plugin) adds more search instances with their own settings. This plugin offers hooks for it: `tinxdk_search_settings_defaults`, `tinxdk_search_sanitize_settings`, `tinxdk_search_max_instances`, `tinxdk_search_sources`, `tinxdk_search_query_args`, `tinxdk_search_results`, `tinxdk_search_result_item`, `tinxdk_search_render_args`, `tinxdk_search_rows`, `tinxdk_search_admin_sections` and `tinxdk_search_loaded`.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it from the Plugins screen, then activate it.
2. Open **TINXDK Søg** in the admin menu, choose the sources and design, and save.
3. Place the search with the block "TINXDK Søg", the shortcode `[tinxdk_search]`, or tick "Replace the theme's search form" / "Replace WooCommerce search" on the settings page.

== Frequently Asked Questions ==

= Does it need WooCommerce? =

No. Without WooCommerce it searches posts, pages and custom post types. With WooCommerce, products, product categories, SKU, EAN/GTIN and prices are included.

= Where does the EAN come from? =

From the WooCommerce GTIN/UPC/EAN/ISBN field (`_global_unique_id`). Products that carry the number in another field can be added with the `tinxdk_search_query_args` filter.

= Which prices are shown? =

The prices WooCommerce calculates, with VAT shown as the shop is set up: both excluding and including VAT, only one of them, or WooCommerce's own price display (the setting is on the plugin page).

= Can I have several search fields with different settings? =

Lite has one search instance (id `default`) that you can place as many times as you like. More instances come with the Pro add-on.

= Does it send data to any external service? =

No. See "External services" below.

= Do I need a captcha? =

No. A search is a read-only request that returns public content only. The plugin has no form that stores or sends data.

== External services ==

TINXDK Search Lite uses no external services. It makes no requests to any other server, loads no external fonts or scripts, and sends no data anywhere. Searches are answered by your own site.

== Changelog ==

= 1.0.0 =
* First release: live search with grouped results for products, categories, pages, posts and custom post types; SKU and EAN/GTIN search; VAT-aware prices; shortcode, block and replacement of the theme and WooCommerce search forms; results page override; five themes with live preview; keyboard navigation, ARIA and mobile full-screen mode.
* One search instance; extension points for add-ons (`tinxdk_search_max_instances`, `tinxdk_search_sources`, `tinxdk_search_query_args`, `tinxdk_search_results`, `tinxdk_search_result_item`, `tinxdk_search_render_args`, `tinxdk_search_settings_defaults`, `tinxdk_search_sanitize_settings`, `tinxdk_search_admin_sections`, `tinxdk_search_loaded`).
* A dismissible note about the Pro add-on on the plugin page and a "Pro" link in the plugin row.

== Upgrade Notice ==

= 1.0.0 =
First release.
