Live Search - Upgrading to 1.1.0
Release 1.1.0 replaces the deprecated Live Search JavaScript SDK with the supported GraphQL implementation and includes bug fixes and other minor improvements.
Breaking Changes
The window.MagentoLiveSearch and window.LiveSearchMetrics objects no longer exist. Any custom code that uses them must be updated.
Overrides of search_as_you_type.phtml
In 1.0.x, Hyva_MagentoLiveSearch::search_as_you_type.phtml contains both the markup and the initLiveSearch Alpine component.
In 1.1.0, the component moves to Hyva_MagentoLiveSearch::search_as_you_type_script.phtml, rendered by the
hyva.livesearch.search.script block in before.body.end.
If your theme overrides search_as_you_type.phtml, redo the override from the 1.1.0 template. The 1.0.x markup does not
work with the 1.1.0 component: methods such as initPopover and showProductPrice no longer exist, and clicking a
suggestion throws an error.
The product objects in the popover have also changed:
priceis now the minimum final price. In 1.0.x it was the maximum regular price.imageis no longer the image URL. UseimageUrlinstead.currencyandidhave been removed.
New API endpoint
The popover now sends requests to Adobe's Catalog Service instead of https://commerce.adobe.io/search/graphql.
The module picks the endpoint automatically from the Services Connector environment:
- Production:
https://catalog-service.adobe.io/graphql - Sandbox:
https://catalog-service-sandbox.adobe.io/graphql
No configuration is needed. The module adds both hosts to the Magento CSP connect-src allowlist. If you also restrict
connect-src outside Magento, for example on a CDN, allow the new hosts there.
To point the popover at a different URL, override the live_search/api/production_endpoint or
live_search/api/sandbox_endpoint config path. These paths have no admin field, so set them with
bin/magento config:set or in app/etc/env.php.
Extending the search query
The search popover now uses the Live Search productSearch GraphQL query.
This query can be extended to request additional product fields. See the
Live Search docs for details.
Changelogs
The changelog is available here.
Tooling
Please refer to the Hyvä Enterprise upgrade docs for helpful information on how to upgrade.