Advanced Ajax Search

5 min read

The Ajax Search feature provides a powerful, real-time product search experience for your WooCommerce store. As customers type in the search box, products matching their query appear instantly—without page reloads. This creates a faster, more engaging shopping experience that helps customers find products quickly.

Key Capabilities

  • Instant Search Results: Products appear as customers type, with no page refresh required
  • Multiple Layout Options: Choose dropdown, full-width, or modal (Pro) display styles
  • Smart Search: Search across product titles, descriptions, SKUs, categories, and more
  • Rich Product Cards: Display images, prices, ratings, stock status, and sale badges
  • Category Filtering: Allow customers to narrow results by product category
  • Recent & Popular Searches: Show helpful suggestions based on search history
  • Search Analytics (Pro): Track what customers are searching for and optimize your store

Getting Started #

Enabling Ajax Search

  1. Go to Swift Commerce → Ajax Search in your WordPress admin
  2. Toggle Enable Ajax Search to turn on the feature
  3. Configure your preferred settings across the available tabs
  4. Click Save to apply your changes

Once enabled, the Ajax Search will automatically replace your theme’s default WooCommerce product search (if enabled in settings).


Adding Ajax Search to Your Site #

There are two main ways to add the Ajax Search widget to your pages:

Method 1: Using the Shortcode

The easiest way to add Ajax Search anywhere on your site is using the shortcode.

Basic Shortcode:

[swift_commerce_search]

Simply paste this shortcode into any page, post, or widget area where you want the search to appear.

Shortcode with Options:

Example Shortcodes:

Method 2: Using Elementor Widget (Pro)

If you’re using Elementor page builder, you can drag and drop the Ajax Search widget directly onto your page.

Steps:

  1. Open any page in Elementor editor
  2. Search for “Ajax Product Search” in the widgets panel
  3. Drag the widget to your desired location
  4. Configure settings in the Elementor panel

Elementor Widget Features:

SettingDescription
TemplateChoose from Default, Modern, Classic, or Custom styling
Placeholder TextCustomize the search input placeholder
Results LayoutDropdown, Full Width, or Modal
Category FilterShow/hide category dropdown
Display OptionsToggle images, prices, ratings, stock, etc.
Style ControlsFull control over colors, typography, spacing, and shadows

Available Templates:

  • Default: Clean minimalist design with subtle borders and light shadows
  • Modern: Fully rounded corners, prominent shadows, and bold colors
  • Classic: Traditional squared design with solid borders
  • Custom: Full control over every styling aspect

General Tab #

Configure core search behavior and performance settings.

Search Behavior

SettingDescriptionDefault
Minimum CharactersNumber of characters required before search starts3
Maximum ResultsMaximum products to show in dropdown10
Search DelayMilliseconds to wait after typing before searching300ms

Tips:

  • Lower search delay feels more responsive but increases server load
  • Set minimum characters to 2-3 to balance relevance with usability
  • Limit maximum results to 8-12 for best visual experience

Performance & Caching

SettingDescriptionDefault
Enable Search CacheCache search results for faster repeated searchesOff
Cache DurationHow long to keep results in cache1 hour

Enable caching on high-traffic stores to reduce database queries.


Search Tab #

Configure which product fields are searched and set up filtering options.

Search Fields (Pro)

Select which product data to include when searching:

FieldDescription
Product TitleSearch in product names
Product ContentSearch in full product description
Short DescriptionSearch in product excerpt
SKUSearch by product SKU number
CategoriesInclude category names in search
TagsInclude product tags in search
AttributesSearch in product attributes (color, size, etc.)

Stock Settings

SettingDescriptionDefault
Include Out of StockShow out-of-stock products in resultsOn

Category Exclusions

Exclude specific product categories from appearing in search results. Useful for hiding:

  • Private or internal categories
  • Wholesale-only products
  • Discontinued product categories

Customization Tab #

The Customization tab consolidates all visual settings including templates, display options, colors, and styling.

Templates

Choose how search results are displayed:

TemplateDescription
DropdownResults appear directly below the search input
Full WidthResults span the full page width
Modal (Pro)Results appear in a centered overlay with blur background

Result Columns (Pro)

Display search results in single or double column layout.

Width Control

SettingDescriptionDefault
Full WidthExpand search to fill containerOff
Maximum WidthMaximum width in pixels (when not full width)500px

Product Information (Pro)

Toggle which product details appear in search results:

OptionDescription
Product ImageShow product thumbnail
Product PriceDisplay current price (with sale price if applicable)
Category NameShow product category below title
SKUDisplay product SKU number
Product RatingShow star rating and review count
Stock StatusDisplay in stock / out of stock label
Sale BadgeShow “Sale” badge for discounted products

Description Settings (Pro)

SettingDescriptionDefault
Show DescriptionDisplay a short product excerptOff
Description LengthMaximum characters to display50

Colors

Customize the color scheme to match your brand:

ColorDescriptionDefault
Primary ColorMain accent color (buttons, highlights)#2271b1
Secondary ColorSecondary accent color#135e96
Text ColorMain text color#333333
Background ColorResults container background#ffffff

Input Style

SettingDescriptionDefault
Input HeightHeight of search input field44px
Input Font SizeFont size in the search input14px
Border ColorInput border color#e0e0e0
Border WidthInput border thickness1px
Focus Border ColorBorder color when input is focused#2271b1

Border & Shadow

SettingDescriptionDefault
Border RadiusCorner roundness for input and results8px
Box ShadowShadow style: None, Light, Medium, HeavyLight

Text Labels

Customize the text shown to users:

SettingDescriptionDefault
PlaceholderText shown in empty search field“Search products…”
No ResultsMessage when no products found“No products found”
View AllLink text to see all results“View all results”
SearchingText shown while loading results“Searching…”

Analytics Tab (Pro) #

Track and analyze customer search behavior to optimize your store.

Overview Metrics

MetricDescription
Total SearchesNumber of searches performed
Unique SearchesNumber of distinct search terms
Searches with ResultsSearches that returned products
Searches without ResultsSearches with no matching products
Click-Through RatePercentage of searches that led to product clicks
Average ResultsAverage number of products shown per search

Top Search Terms

View the most frequently searched terms in your store, including:

  • Search term
  • Number of searches
  • Number of clicks
  • Click-through rate (CTR)

Use this data to:

  • Identify popular products to promote
  • Discover product naming opportunities
  • Improve product titles and descriptions

No-Result Searches

See which searches returned zero results. This helps you:

  • Identify missing products customers want
  • Add synonyms for common alternate spellings
  • Improve product discoverability

Data Actions

ActionDescription
RefreshUpdate analytics data
ExportDownload data as CSV or JSON
ClearDelete all analytics data

Time Period Filter

View analytics for:

  • Last 7 days
  • Last 30 days
  • Last 90 days
  • All time
Updated on March 14, 2026
Scroll to Top