Skip to content

Adobe Commerce - Hyvä Theme - Upgrading to 1.0.0 (from 0.7.0 pre-release version)

Release 1.0.0 is the first stable release of the Hyvä theme compatibility modules for Adobe Commerce (the commerce-metapackage). It provides Hyvä storefront compatibility for the Adobe Commerce-only features (Gift Card, Gift Wrapping, Reward Points, RMA, Multiple Wishlist, Customer Balance, Customer Custom Attributes, Catalog Events and more).

This upgrade guide covers notable changes from the previously released early access version: 0.7.0.

Prior changes are not covered (i.e. 0.6.x and lower).

Info

This release is primarily consolidation, hardening and bug fixes rather than new features - duplicated logic has been moved into the base modules, several templates have been migrated from Magento helpers to Hyvä View Models, CSP inline-script registration has been corrected, and a number of rendering/escaping bugs have been fixed. There are no new storefront features.

Notable news

CSP inline-script registration corrected

Across several modules, the CSP inline-script registration was being invoked with short-echo tags (<?= $hyvaCsp->registerInlineScript(); ?>) even though \Hyva\Theme\ViewModel\HyvaCsp::registerInlineScript() returns void and echoes its output internally. This was changed to the statement form (<?php $hyvaCsp->registerInlineScript(); ?>).

  • Affected templates:
    • Hyva_MagentoCustomerBalance::php-cart/totals/js/customer-balance-js.phtml
    • Hyva_MagentoGiftWrapping::php-cart/totals/js/gift-wrapping-js.phtml
    • Hyva_MagentoGiftCard::cart/giftcard/js/giftcard-total-js.phtml and php-cart/giftcard/js/giftcard-total-js.phtml
    • Hyva_MagentoReward::totals/js/rewards-js.phtml

Form validation rules consolidated into the base Hyvä Theme module

The custom form validation rules that previously lived in Hyva_Enterprise have been moved into the base Hyva_Theme module, removing duplicated code. The JavaScript rules themselves (dateFromTo, minMax, file-type, file-max-size, image-max-dimensions, url, etc.) are unchanged and still registered via the same advanced JavaScript form validation API - only their location has changed.

Backwards compatibility

Any theme or module that referenced the Hyva_Enterprise::form/*-validation.phtml templates or their named layout blocks (date.validation, file.upload.validation, additional.input.validation, min.max.validation) must repoint to the Hyva_Theme equivalents. The Hyva_MagentoRma and Hyva_MagentoCustomerCustomAttributes modules already consume the rules from Hyva_Theme.

Magento helpers migrated to Hyvä View Models

Templates that called Magento core helpers directly ($this->helper(...)) have been migrated to dedicated Hyvä View Models, the recommended Hyvä pattern.

  • Hyva_MagentoReward
    • New View Model \Hyva\MagentoReward\ViewModel\Reward (extends \Magento\Reward\Helper\Data)
    • The customer/reward/info.phtml and tooltip.phtml templates now use it instead of $this->helper(\Magento\Reward\Helper\Data::class)
  • Hyva_MagentoRma
    • New View Model \Hyva\MagentoRma\ViewModel\RmaTracking (getTrackingPopupUrlBySalesModel()), and \Hyva\MagentoRma\ViewModel\CreateRma gained a new public method getReturnCreateUrl(Order $order)
    • The order/button.phtml and return/tracking.phtml templates now use these View Models instead of \Magento\Rma\Helper\Data
  • Hyva_MagentoAdvancedCheckout
    • cart/item/failed.phtml now uses \Hyva\Theme\ViewModel\ProductPrice (displayPriceIncludingTax(), getPriceValueInclTax(), getPriceValueExclTax(), getPriceDisplayType()) instead of \Magento\Tax\Helper\Data and \Magento\Catalog\Helper\Data

Backwards compatibility

Child themes overriding any of these templates that relied on the old $helper / $this->helper(...) variables must be updated to use the View Models. \Hyva\MagentoRma\ViewModel\CreateRma now requires \Magento\Framework\UrlInterface and \Magento\Customer\Model\Session constructor arguments, so any di.xml override or subclass must supply them.

Gift Card price component refactored

Hyva_MagentoGiftCard previously generated a uniquely-named inline Alpine component (initPrice<productId>()) inside product/price-giftcard.phtml for every gift-card price box on the page. This is replaced with a single shared, data-attribute driven component.

  • New template Hyva_MagentoGiftCard::js/gift-card-price.phtml defines a single shared initGiftCardPrice component, registered into before.body.end as the giftcard.price.js block (see hyva_catalog_product_view_type_giftcard.xml).
  • product/price-giftcard.phtml no longer emits an inline <script>; its root element now uses x-data="initGiftCardPrice" and passes state via data-* attributes (data-product-id, data-display-tax, data-initial-final-price, data-initial-tier-prices, data-regular-price, data-is-saleable).
  • This prevents duplicate component definitions when multiple gift-card price boxes render. The window event contract is preserved (update-prices-<productId>, update-qty-<productId>, update-custom-option-active, update-custom-option-prices in; update-product-final-price out).

Backwards compatibility

Custom code that referenced the old per-product initPrice<productId> component will break and must be updated to the shared initGiftCardPrice component.

Bug fixes

  • Hyva_MagentoMultipleWishlist - wishlist item prices did not render when multiple wishlists were disabled (multiple_enabled=0, the default). The price-render block in hyva_wishlist_index_index.xml was renamed to multiple.product.price.render.wishlist (with as="product.price.render.wishlist") to avoid a block-name collision with the base Magento_Wishlist handle.
    • Backwards compatibility: layout customisations that targeted this block by name (referenceBlock name="product.price.render.wishlist") in the multiple-wishlist context should use the new block name. The as alias preserves the template-level lookup, so most overrides are unaffected.
  • Hyva_MagentoCatalogEvent - the placeholder image fallback in catalog/event/item/renderer.phtml now resolves via $block->getViewFileUrl(...) instead of $this->getViewFileUrl(...).
  • Hyva_MagentoGiftCard - removed a stray echo 'product not found'; debug output that printed on the page when no saleable product was found; corrected escapers (escapeJs() for JS-context strings, escapeHtml() for <label> text).
  • Hyva_MagentoReward - corrected title attribute escaping to escapeHtmlAttr() in customer/reward/subscription.phtml.
  • Hyva_MagentoRma - the Return button (order/button.phtml) is now gated by ifconfig="sales/magento_rma/enabled" across all sales/RMA order layouts, so it is hidden when RMA is disabled. Guest-returns "Return" URLs now route correctly to magento_rma/guest/create for guests vs magento_rma/returns/create for logged-in customers (via the new CreateRma::getReturnCreateUrl()).

Admin theme and branding

  • New compile-time LESS pre-processor plugin (\Hyva\Enterprise\Plugin\AdminThemeLessVariableOverrides, registered via di.xml) injects LESS variable overrides into the Hyva/commerce admin theme, overriding the primary brand colour to Hyvä purple (@hyva-purple and its lighter/darker shades).
  • New admin configuration tab "Hyvä Enterprise" (hyva_commerce, src/etc/adminhtml/system.xml) with the Enterprise logo applied via src/view/adminhtml/web/css/source/_module.less.
  • New branding assets: favicon.ico, hyva-enterprise-login.svg, hyva-enterprise-logo.svg and a new hyva-enterprise-squircle.svg logo variant.

Backwards compatibility

Hyva_Enterprise now declares a hard sequence dependency on Hyva_Commerce in module.xml.

Deprecated code removed

Hyva_Enterprise

The form-validation layouts and templates were removed (now provided by Hyva_Theme).

Layout files
  • Hyva_Enterprise::hyva_form_validation_date.xml
  • Hyva_Enterprise::hyva_form_validation_files.xml
  • Hyva_Enterprise::hyva_form_validation_input_additional.xml
  • Hyva_Enterprise::hyva_form_validation_min_max.xml
Template files
  • Hyva_Enterprise::form/date-validation.phtml
  • Hyva_Enterprise::form/file-validation.phtml
  • Hyva_Enterprise::form/input-additional-validation.phtml
  • Hyva_Enterprise::form/min-max-validation.phtml

Hyva_MagentoGiftCard

The per-product inline initPrice<productId> Alpine component and its inline <script> in product/price-giftcard.phtml were removed in favour of the shared js/gift-card-price.phtml component (see above).

Translated phrases

A number of additional translated phrases were added to Hyva_Enterprise (src/i18n/en_US.csv), covering Adobe Commerce features (Gift Wrapping, Wish Lists, Reward Points, RMA/shipment tracking) and Hyvä-specific configuration notes.

Hyvä only supports the native input date type format
If empty, we'll automatically set the width value in pixels (not used in Hyvä Themes).
Number of Items to display at once (not used in Hyvä Themes).
Number of Items to scroll per click (not used in Hyvä Themes).
Create Wishlist
Rename Wish List
Wishlist Name
Select a Wish List:
The wishlist could not be found.
You have no items in this wishlist.
Gift Wrapping for Items
Gift Wrapping for Order
Gift Wrapping:
Gift Receipt:
Printed Card:
My Reward Points
Earn %1 for purchases your invitees make.
Send this invitation now and earn %1 when your invitee signs up on our site.
You can reward up to %1 invitee purchase(s).
You can reward up to %1 invitee registration(s).
Invalid form key. Please refresh the page and try again.
We could not add the items to shopping cart.
No banners found
Sale Events
Tracking Carrier
Tracking number

Changelogs

The changelog is available here.

Tooling

Please refer to the Hyvä Enterprise upgrade docs for helpful information on how to upgrade.

Known Issues

Please check the GitLab issue tracker for known issues.