A Magento 2 module that adds Hyvä compatibility to the FACT-Finder-Web-Components/magento2-module / omikron/magento2-factfinder compatibility* for Hvyä Themes projects.
*Note: this is purely a compatibility project, not a full reimplementation.
Magento 2 with a version of Hyvä Themes. You will then need to install and setup FACT-Finder-Web-Components/magento2-module before continuing.
- Adding FACT-Finder search form wrapper to the default search block in the header.
- Load FACT-Finder JS without the need for requirejs.
- Load FACT-Finder CSS.
Magento 2.4.2 (Open Source or Commerce), PHP 7.4 are recommended as a minimum*. You'll also need a version of Hyvä Themes.
*2.4.0/2.4.1 (or patch versions) and PHP 7.3 may work, but have not been tested, nor will they be supported.
- Install via composer
composer config repositories.hyva-themes/factfinder git [email protected]:hyva-themes/hyva-compat/factfinder.git
composer require hyva-themes/factfinder
- Enable the module
bin/magento module:enable Develodesign_FactfinderHyvaCompat
- Run setup:upgrade
bin/magento setup:upgrade
- Flush the cache
bin/magento cache:flush
- Copy the CSS to your projects Hyvä based theme
cp vendor/develodesign/module-factfinderhyvacompat/view/frontend/web/tailwind/factfinder-bridge/ {PATH_TO_YOUR_THEME}/web/tailwind/theme/factfinder-bridge/
Note: Any styling changes you would like to make to the FACT-Finder, do so within the {PATH_TO_YOUR_THEME}/web/tailwind/theme/factfinder-bridge/ folder.
- Add CSS to your Tailwind CSS output
Edit the
{PATH_TO_YOUR_THEME}/web/tailwind/tailwind-source.css
file and import the above CSS file by adding@import url(theme/factfinder-bridge/import.css);
after the line containing the/* purgecss start ignore */
comment but before the line containing the/* purgecss end ignore */
comment.
Note: It is important you add this between the comments stated above otherwise they may not be included once purged as FACT-Finder classes are dynamically added via JS to elements on the page.
- Rebuild Tailwind CSS output
From the {PATH_TO_YOUR_THEME}/web/tailwind
directory, run either of the below based on your target environment.
For development
npm run build-dev
For production
npm run build-prod
-
Error: Call to a member function isSuggestionsAllowed() on null
- This is fixed by installing and fully setting up (including FACT-Finder API credentials) the FACT-Finder-Web-Components/magento2-module first before installing this compat module.