chk/voicesearch

Adds a voice search microphone button to the Magento 2 storefront search bar, enabling customers to search by speech.

Maintainers

Package info

github.com/koushikch7/Magento2-VoiceSearch

Type:magento2-module

pkg:composer/chk/voicesearch

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

2.0.0 2026-08-06 05:21 UTC

This package is auto-updated.

Last update: 2026-08-06 05:35:46 UTC


README

Adds a microphone button to the Magento 2 Luma storefront search bar so customers can search by speaking instead of typing.

Requirements

Dependency Version
PHP 8.1 – 8.4
Magento 2.4.4 – 2.4.x
Browser Chrome / Edge (Chromium) — requires Web Speech API + HTTPS

Note: iOS Safari and Firefox do not support the Web Speech API. The mic button is automatically hidden on unsupported browsers and non-HTTPS pages.

Installation

Composer (recommended)

composer require chk/voicesearch
bin/magento module:enable CHK_VoiceSearch
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Manual

  1. Copy the module directory to app/code/CHK/VoiceSearch/
  2. Run the commands above from step 2.

Configuration

Stores → Configuration → CHK Voice Search Tools → Search by Voice

Setting Options Default
Module Enabled Yes / No No
Input Search ID HTML id of the search input search
Device Scope Mobile only / Desktop & tablet / All Mobile
Voice Language 60 locales across 35 languages en-US

Store must be served over HTTPS for the browser to grant microphone access.

How It Works

  1. A mic icon is injected into the Luma search bar (inside the search input for desktop; floated alongside the form for mobile).
  2. Clicking the mic starts speech recognition via the browser's SpeechRecognition API (Chrome / Edge).
  3. When the browser returns a transcript, the module fills the search input and submits the form automatically.

Supported Languages (60 locales)

Afrikaans, Albanian, Arabic (SA / AE / EG), Bulgarian, Catalan, Chinese (Simplified / Traditional), Croatian, Czech, Danish, Dutch, English (AU / CA / IN / NZ / ZA / GB / US), Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian, Polish, Portuguese (BR / PT), Romanian, Russian, Slovak, Slovenian, Spanish (AR / CL / CO / MX / ES / US / VE), Swedish, Thai, Turkish, Ukrainian, Vietnamese, Welsh.

Compatibility Notes

  • Tested with the Luma theme. Custom themes may need LESS recompilation.
  • The top.search block template is overridden module-wide via view/frontend/layout/default.xml. If another extension also overrides this template, adjust via a custom layout.

License

OSL-3.0 / AFL-3.0

Author

Koushik CH — contact@chkoushik.comchkoushik.com