Hyvä Compatibility
The module supports the Hyvä Theme natively since version 1.26.0. It provides a custom block for the VAT number field which must be incorporated in your template files, basically with just one line of code.
Implementation
Place the following code in the templates where you want the VAT number field to appear. The block is added to the corresponding form block with layout.xml.
Registration form
If you enable the address fields at registration, customers can provide their full company address directly. Usually that is the area where you also want to provide the field for the VAT number so customers get the corrrect pricing and group assignment right away.
In your template, for example app/design/frontend/MyVendor/mytheme/Magento_Customer/templates/form/register.phtml:
//$block is usually an instance of Magento\Customer\Block\Form\Register
<?php echo $block->getChildHtml('account_create.vat_id'); ?>
Address edit form
Customers can add, edit or delete addresses within their account. To provide the VAT number field there, add this to your template, for example: app/design/frontend/MyVendor/mytheme/Magento_Customer/templates/address/edit.phtml
//$block is usually an instance of Magento\Customer\Block\Address\Edit
<?php if ($addressViewModel->addressIsVatAttributeVisible()): ?>
<?= $block->getChildHtml('customer_address.vat_id') ?>
<?php endif ?>
Basically that is the only thing you need to do to bring the field on the registration (hyva_customer_account_create.xml) and address edit (hyva_customer_address_form.xml) forms.
Migration from older versions
Starting with version 1.26.0, the Hyva Theme compatibility that was previously provided by a separate module is now built into the main Geissweb_Euvat module:
| Separate Module | Covered Area | Status |
|---|---|---|
hyva-themes/magento2-geissweb-euvat (Hyva_GeisswebEuvat) |
Customer registration, address editing | Deprecated — now integrated |
hyva-themes/magento2-hyva-checkout-geissweb-euvat (Hyva_GeisswebEuvatCheckout) |
Hyva Checkout | Still required separately |
This means:
- You no longer need the
hyva-themes/magento2-geissweb-euvatmodule for Hyva Theme compatibility - The main module handles Hyva Theme (registration + address edit) natively
Migrate customizations for the block class
This is only needed if you extended our block class with a plugin or rewrite. Update class references in your `di.xml` and PHP files.
Old class: Hyva\GeisswebEuvat\Block\VatNumber\Field
New class: Geissweb\Euvat\Block\Hyva\VatNumber\Field
Hyvä Checkout Compatibility
For compatibility with Hyvä Checkout, you need to install the Checkout compatibility module which is available at the Hyvä GitLab instance: Compatibility module for Hyvä Checkout
Troubleshooting
Composer Conflict Error
If you see a conflict error during composer update:
geissweb/module-euvat conflicts with hyva-themes/magento2-geissweb-euvat
This is expected. Remove the old Hyva Theme module first (see Step 1 above).