chk / voicesearch
Adds a voice search microphone button to the Magento 2 storefront search bar, enabling customers to search by speech.
Package info
github.com/koushikch7/Magento2-VoiceSearch
Type:magento2-module
pkg:composer/chk/voicesearch
Requires
- php: >=8.1
- magento/framework: ~103.0 || ~104.0
- magento/module-search: ~101.0 || ~102.0
Requires (Dev)
- magento/marketplace-eqp: ^3.0
- phpunit/phpunit: ~10.0
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
- Copy the module directory to
app/code/CHK/VoiceSearch/ - 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
- A mic icon is injected into the Luma search bar (inside the search input for desktop; floated alongside the form for mobile).
- Clicking the mic starts speech recognition via the browser's
SpeechRecognitionAPI (Chrome / Edge). - 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.searchblock template is overridden module-wide viaview/frontend/layout/default.xml. If another extension also overrides this template, adjust via a custom layout.
License
Author
Koushik CH — contact@chkoushik.com — chkoushik.com