As of December 31, 2023, Shopify no longer allows apps to modify theme code.
To integrate Autocomplete and InstantSearch, use the Algolia AI Search & Discovery appβs App Embed and App Blocks.
To get started, see Quickstart and Algolia configuration.
- Automatically, in the Shopify admin
- Manually, if you have a custom implementation
Automatic migration in the Shopify admin
To automatically migrate the third-party libraries, reinstall Algolia into your theme. This overrides the third-party libraries and scripts with up-to-date versions.If you changed or customized your theme by editing the scripts provided by the Algolia AI Search & Discovery app,
proceed with a manual migration.
Otherwise, you will lose your changes.
- Open the Display tab.
-
Click Install to a new theme.
-
Select the theme you want to update.
A migration notice shows more information.
- Click Finish installation.
Manual migration
If your shop has a custom theme or relies on non-standard versions of external libraries, you have to manually update your theme.Migrate libraries in your theme
-
Open the theme code editor.
-
Open the
layout/theme.liquid
file. -
For each asset with a
jsdelivr.net
URL:- Open the URL in your browser, and copy the content.
- Click Assets > Add a new asset, and select Create a blank file. Use the same filename as the opened file.
- Paste the copied content in the newly created asset.
-
After creating assets from each
jsdelivr.net
URL, update their associated URLs in thetheme.liquid
file. Change{{ '//cdn.jsdelivr.net/folder/filename.js' | script_tag }}
to{{ 'filename.js' | asset_url | script_tag }}
.filename.js
is the name of the newly created asset. - Save the file.
Make sure to maintain the file order.
Migrate third-party web fonts
The InstantSearch widget uses the Font Awesome icon pack, which uses custom web fonts that are hosted on the jsDelivr CDN. To migrate the libraries to the Shopify CDN, follow these steps:- Download the following files and name them as specified:
- Create six new assets files, one for each font.
- In the Shopify Theme Editor, click Assets > Add a new asset and select Upload a file. Upload all six files that you previously downloaded.
-
In the Theme Editor, open
algolia_dependency_font-awesome-4-4-0.min.css.liquid
. Make the following changes:- Replace all occurrences of
../fonts
with./algolia_dependency
- Replace:
./algolia_dependency_fontawesome-webfont.eot?#iefix&v=4.4.0
with./algolia_dependency_fontawesome-webfont-ie-fix.eot?#iefix&v=4.4.0
- Replace all occurrences of