Simple Product Ajax Search Engine

By Daniel Esparza

0+ active installationsVersion 1.1.0

Real-time AJAX search for WooCommerce products with the shortcode [simple-product-ajaxsearch-engine].

Description

Simple Product Ajax Search Engine adds an AJAX search box that shows live results from your WooCommerce catalog with the shortcode:

  • [simple-product-ajaxsearch-engine]: adds a search field and a results list with thumbnail, title, price and excerpt.
  • Live search: results update while the customer types (from 3 characters), without reloading the page.
  • Native integration: uses the WooCommerce product post type and native WordPress functions.
  • Several search boxes per page: each shortcode works on its own.
  • Admin option: turn the search on or off from “Store Search” in the admin menu.
  • Translation ready: all strings are ready to be translated.

Video

Installation

  1. Upload the simple-product-ajax-search-engine folder to /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu in WordPress (WooCommerce must be active).
  3. Go to Store Search in the admin menu and check “Search enabled”.
  4. Add the shortcode [simple-product-ajaxsearch-engine] where you want the search box.

FAQ

How many results are shown?

Up to 5 products per search.

What happens if WooCommerce is not active?

WooCommerce is required. WordPress will not activate the plugin without it.

Where can I customize the styles?

Edit public/css/styles.css or add your own CSS in your theme or a snippets plugin. The search field uses the class .spase-product-search-input and the results container .spase-product-results.

Screenshots

Changelog

1.1.0

  • Declared the WooCommerce dependency (Requires Plugins) and HPOS compatibility.
  • Search starts at 3 characters (the same minimum as the server), waits 250 ms after typing and also reacts to pasted text.
  • Several search boxes can be used on the same page (classes instead of IDs).
  • The character count now handles accents and ñ correctly.
  • When the search is disabled, the shortcode shows nothing.
  • CSS and JS now load only on pages that contain the shortcode.
  • Escaped the product image output and removed !important from the CSS.
  • Interface strings in English, ready for translation on translate.wordpress.org.
  • Plugin header: added Requires at least, Requires PHP and License URI.

1.0.0

  • Initial release.
  • Shortcode [simple-product-ajaxsearch-engine].
  • Real-time AJAX search.
  • Thumbnails, prices and excerpts in the results.
  • Settings page in the dashboard.