Tax Switch Hyva
v1.1.8
Tax Switch Hyva
- Mises à jour et support inclus pendant 12 mois
- Documentation complète incluse
- Compatible avec les thèmes Hyvä
- Installation prête pour Composer
Tax Switch — Hyvä
Le module compagnon Hyvä de wimakeit/module-tax-switch. Si vous faites tourner le module Tax Switch sur un storefront Hyvä, installez aussi celui-ci : il remplace les templates Luma (RequireJS + jQuery) par des composants Alpine.js et des price labels en vanilla JS, tout en réutilisant la même configuration admin, le même cookie et le même ViewModel.
Vous installez ce module en complément du module Tax Switch principal — jamais à sa place. Le module principal possède la configuration, la couche plugin et l'intégration FPC ; celui-ci possède le rendu compatible Hyvä.
À qui ça s'adresse
- Boutiques sous Hyvä Themes qui ont besoin d'un switcher de display mode taxe (HT/TTC) sans réintroduire RequireJS dans leur bundle
- Setups multi-frontend où Luma et Hyvä cohabitent et ont besoin d'un comportement tax-switch cohérent
- Projets Hyvä qui veulent l'ensemble des features Tax Switch (visibility rules, styling, price labels, quatre styles d'affichage) sans écrire leurs propres composants Alpine.js
Bénéfices clés
- Composants Alpine.js, pas de jQuery — les styles radio, toggle, segmented et dropdown sont réimplémentés avec
x-datapour s'intégrer naturellement dans un bundle Hyvä. - Price labels en vanilla JS — labels HT/TTC auto-sizés à côté des prix, sans dépendance à RequireJS ou
mage/cookies. - Réutilise la configuration du module principal — tous les réglages admin (visibility, styling, labels, customer groups, devices) vivent dans le module Tax Switch principal. Rien de neuf à apprendre ou configurer ici.
- Retire les blocs Luma — supprime automatiquement les blocs originaux basés sur RequireJS depuis le layout, pour que les thèmes Hyvä ne les chargent pas par erreur.
- Hook par variables CSS — surchargez les défauts depuis le CSS de votre thème Hyvä via un set propre de variables
--wmi-tax-*(gap, bg, radius, font-size, border, couleurs actives).
Compatibilité
- Magento 2.4.x / équivalent Mage-OS
- PHP 8.1, 8.2, 8.3
- Nécessite
wimakeit/module-tax-switch1.0 ou supérieur (ce module est un addon frontend, pas une logique de tax-switching autonome) - Nécessite le module de base Hyvä Themes officiel (
hyva-themes/magento2-theme-module1.0+) - Un thème de storefront basé sur Hyvä
Installez ce module via Composer. Assurez-vous que votre auth.json est configuré avec vos identifiants Wimakeit.
$ composer require wimakeit/module-tax-switch-hyva:^1.1.8
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
Installation notes
The standard composer require + setup:upgrade + setup:di:compile flow applies. The points below cover what's specific to this module.
Required Wimakeit dependency
This module is a frontend addon for Hyvä. It cannot work on its own — you must install the main Tax Switch module alongside it:
| Package | Minimum | Role |
|---|---|---|
wimakeit/module-tax-switch | 1.0 | owns the admin config, the plugin layer, the FPC integration and the ViewModel |
wimakeit/module-tax-switch-hyva | this module | replaces the Luma templates with Hyvä-compatible Alpine.js / vanilla-JS components |
Required third-party dependency
| Package | Minimum |
|---|---|
hyva-themes/magento2-theme-module | 1.0 |
Your storefront must run on a Hyvä-based theme. If your store is on Luma, install only the main wimakeit/module-tax-switch and skip this one.
Configuration
There is no admin configuration specific to this module. All settings — enable/disable, default display mode, available modes, display style, visibility, customer groups, device targeting, price labels, styling (CSS variables) — live in the main module under Stores → Configuration → Wimakeit → Tax Switcher.
What this module changes
| Layer | Luma (main module) | Hyvä (this module) |
|---|---|---|
| JS framework | RequireJS + jQuery | Alpine.js + vanilla JS |
| Initialisation | data-mage-init | x-data / inline scripts |
| Cookie handling | mage/cookies | native document.cookie |
| Template namespace | Wimakeit_TaxSwitch:: | Wimakeit_TaxSwitchHyva:: |
The Hyvä module removes the original Luma blocks from the page (so they don't load on a Hyvä storefront) and registers Hyvä-compatible blocks reading the same configuration.
Customisation
To restyle the switcher from your Hyvä theme, override these CSS variables:
:root {
--wmi-tax-gap: 0.75rem;
--wmi-tax-bg: transparent;
--wmi-tax-bg-hover: rgba(0,0,0,.05);
--wmi-tax-radius: 4px;
--wmi-tax-font-size: 0.8125rem;
--wmi-tax-border: #ddd;
--wmi-tax-active-bg: #333;
--wmi-tax-active-color: #fff;
}
To override templates, copy them into your Hyvä theme:
app/design/frontend/<Vendor>/<Theme>/Wimakeit_TaxSwitchHyva/templates/
- Version
- v1.1.8
- Licence
- Abonnement annuel
- Support
- 12 mois
- Dernière mise à jour
- 5 juin 2026
- Magento
- Magento 2.4.4 Magento 2.4.5 Magento 2.4.6 Magento 2.4.7 Mage-OS 2.0 Mage-OS 2.1
- PHP
- PHP 8.1 PHP 8.2 PHP 8.3
- Hyvä
- Compatible
- Package
-
wimakeit/module-tax-switch-hyva
Vérifier la compatibilité
Indiquez votre stack pour vérifier la compatibilité du module.
Compatibilité 4
Tarification & licence 4
bin/magento module:disable ; le nettoyage est automatique via le revert du setup patch. vendor/wimakeit/ après composer require, donc vous pouvez le lire, l'auditer, et le patcher localement pour votre propre installation Magento. Vous ne pouvez PAS le redistribuer, le sous-licencier, le publier sur un registre Composer public, ou le revendre. 1 licence = 1 domaine production + 1 domaine staging/dev (voir les Conditions Générales pour l'EULA complet). Les modules Wimakeit ne sont PAS sur le packagist.org public — ils sont distribués exclusivement via le registre Composer privé packages.wimakeit.be. Installation & mises à jour 6
composer require wimakeit/module-tax-switch-hyva:^1.1.7, puis bin/magento setup:upgrade, bin/magento setup:di:compile, et enfin bin/magento cache:flush. L'onglet « Installation » de cette page liste chaque étape de configuration (ACLs, crons, valeurs par défaut) — un déploiement prend quelques minutes, pas des heures. Besoin d'aide ? Wimakeit propose des prestations d'installation Magento depuis notre bureau wallon (Presles, entre Charleroi et Namur). auth.json : {"http-basic": {"packages.wimakeit.be": {"username": "VOTRE-EMAIL", "password": "VOTRE-TOKEN"}}}. Étape 3 : enregistrez le repo : composer config repositories.wimakeit composer https://packages.wimakeit.be. Étape 4 : composer require wimakeit/module-tax-switch-hyva:^1.1.7. Dans les pipelines CI/CD, injectez COMPOSER_AUTH en variable d'environnement JSON pour éviter de commiter auth.json. composer require, même code module, même schéma de base — pas de fork à maintenir, pas de changement de licence. composer update reste sûr à l'intérieur d'une version majeure. app/design/frontend/{VotreVendor}/{theme}/Wimakeit_{Module}/templates/ en respectant le même chemin relatif. Blocks, ViewModels et Helpers s'override via DI preference dans votre propre module custom — déclarez <preference for="Wimakeit\…\OriginalClass" type="VotreVendor\Override\Class" /> dans etc/di.xml. Le XML layout s'étend (préféré) ou s'override de manière standard Magento. Les modules Wimakeit n'utilisent jamais le keyword final sur les classes que vous pourriez raisonnablement vouloir override — surcharger est un scénario de premier ordre, pas un hack. Support & sécurité 3
contact@wimakeit.com avec le nom du module, sa version, votre version Magento/Mage-OS et les étapes pour reproduire. Les correctifs sont livrés dans le prochain patch. Le support Wimakeit répond en français, anglais et néerlandais en jours ouvrables (horaires CET). contact@wimakeit.com avec le préfixe [SECURITY] dans l'objet — précisez le module, la version et les étapes de reproduction. Accusé de réception en jours ouvrables, mention dans le Changelog sur souhait du déclarant. Wimakeit est une SRL belge (société à responsabilité limitée) soumise au droit belge et européen sur la vie privée et la divulgation responsable. À propos de Wimakeit 1
Quelque chose n'est pas couvert par la FAQ ?
Signalez un bug ou posez une question — le formulaire est pré-rempli avec ce module.
Changelog
Categories: Security, Feature, Fix, Perf, Admin, Deps.
[1.1.6] - 2026-05-27
Fix
price-label-init.phtmlno longer dies withUncaught SyntaxError: Unexpected end of input. A<script>substring inside a comment was breaking the host HTML parser; rephrased to avoid the literal tag.
[1.1.5] - 2026-05-27
Fix
- Varnish + HttpOnly
X-Magento-Varyno longer trap users in the wrong tax mode. The toggle now reloads onto a one-shot?_tx=<mode>-<ts>URL so Varnish misses and the backend repopulates the cache under the correct vary hash. A defensive self-heal IIFE runs on every page: if the cookie disagrees with the server-rendered mode and no_txis already in the query string, the page transparently reloads cache-busted. Without these, toggling on one page and navigating to another previously-cached page silently reverted the display. - Ships a
noop.phtmland wires the Luma switcher blocks (wimakeit.taxswitch.header/footer/floating/price.label.init) at it viatemplate="Wimakeit_TaxSwitchHyva::noop.phtml", plus belt-and-braces<remove/>+<referenceBlock remove="true"/>. On some Hyvä stacks (magento2-base-layout-resetinteractions) the Luma block can still slip through and render unstyled at the top ofheader.container; on those installs ship a theme override atapp/design/.../Wimakeit_TaxSwitch/templates/tax-switcher.phtmlthat justreturn;s.
Feature
- HTVA / TVAC label is now actually rendered next to prices. The previous flow only sized labels that nothing else ever injected. The price-label initializer now:
- Decorates Hyvä PDP
.product-info-main .price-container .final-price > .price-wrapperand Wimakeit_PageBuilder slider.wm-pb-product__priceserver-side label at boot, and observes the DOM for late-mounted fragments. - Lets themes register extra selectors via
window.wmiTaxLabelSelectors = ['.my-theme-price', …]before the initializer fires. - Ships a
Magento_Catalog::product/price/amount/default.phtmloverride (wired via layoutsetTemplateonproduct.price.render.default) that injects the active label server-side everywhere the standard\Magento\Framework\Pricing\Render\Amountblock is used — PDP info-price-stock, related/upsell sliders, sidebar widgets. - Skips price nodes that already have a sibling
.wmi-tax-labelso server-side template overrides always win.
Admin
- The price-label initializer (and self-heal) now boots whenever the module is enabled — the
show_price_labeltoggle still gates the actual label injection, but the Varnish self-heal must run on every page to be effective.
[1.1.4] - 2026-05-08
Fix
ifconfiglayout paths realigned with thewimakeit_tax_switchconfig section name (renamed inwimakeit/module-tax-switch1.3.2). Previously the Hyvä switcher block could be rendered while the toggle was disabled on stores that upgraded both modules together.
[1.1.3] - 2026-04-29
Deps
- Certified PHP 8.1 → 8.3 support. Composer
phpconstraint tightened to>=8.1 <8.4.
[1.1.2] - 2026-04-28
Deps
- Direct
wimakeit/module-coredependency removed — pulled in transitively viawimakeit/module-tax-switch. The marketplace bundle scanner resolves it correctly.
[1.1.1] - 2026-04-28
Deps
wimakeit/module-coredependency declared explicitly so the marketplace bundle scanner picks it up. Superseded by 1.1.2.
[1.1.0] - 2026-04-22
Feature
- Aligned with
wimakeit/module-tax-switch1.3.0 — the Both (HT + TTC) display mode is removed. Switcher now offers two modes only: Excluding Tax (HT) and Including Tax (TTC).
Admin
- Added missing French translations (
fr_FR) for the switcher aria-labels and screen-reader descriptions.
[1.0.1] - 2026-04-14
Admin
- Composer/Satis distribution archives now exclude internal files (
.gitlab-ci.yml,.claude/,docs/,.gitattributes).
[1.0.0] - 2026-03-12
Feature
- Initial release of Wimakeit Tax Switch — Hyvä compatibility for Magento 2 / Mage-OS.
- Adds the Hyvä-native frontend bits required to render
wimakeit/module-tax-switchon Hyvä themes: Tailwind classes, Alpine.js switcher component, pre-compiled CSS and thehyva_config_generate_beforeobserver that exposes the active tax-display mode to the Hyvä bundle. - Requires
wimakeit/module-tax-switch≥ 1.0 on the same store.
Vous avez trouvé un bug ? Faites-nous-en part.
Un court formulaire s'ouvre dans un nouvel onglet — le nom du module et votre langue sont déjà pré-remplis. Décrivez ce que vous avez tenté, ce qui n'a pas fonctionné, et nous vous répondrons sous un jour ouvré.
Signaler un bug pour Tax Switch HyvaBesoin d'aide ?
Notre équipe est disponible pour vous accompagner dans l'intégration.