Skip to content

Upgrading to 1.3.6

Release 1.3.6 includes performance improvements, bug fixes, features and improved accessibility.

When updating the Hyvä Theme to version 1.3.6, please note to always update the hyva-themes/magento2-theme-module to the latest version as well.

Even if not updating the Default Theme to 1.3.6, it should always be safe to update the Hyva_Theme module to the latest version (package hyva-themes/magento2-theme-module).

Notable news

TailwindCSS version 3.4.1

This release upgrades TailwindCSS to the current version.
Because of this, the minimum version of nodejs is now 16.

Requiring JavaScript dependencies

It now is possible to declare a dependency on JS in a template or block level, meaning that if the template or block is rendered, the required JS will be rendered in the before.body.end container.
This can help reduce the amount of duplicate JavaScript on product listings. Please refer to the documentation for more information.

Less unused or duplicated JavaScript

To improve the CWV metrics of Hyvä stores several duplicated or unnecessary scripts were removed.
PageBuilder content type JavaScript is now only rendered when a given content type is present on the page.
Also, the initPriceBox function is rendered only once instead of once per product on a product listing page.

hyva.activateScripts method

The hyva.activateScripts method takes an Element instance as an argument, extracts all script child elements, and adds them to the document head, so they are parsed by the browser. Please refer to the window.hyva documentation for more information.

Security: the form key is now required for the customer login via Ajax

The renowned security researcher Talesh Seeparsan discovered Magento does not require a form key when logging in via Ajax.
This feature is used when Checkout as Guest is disabled. We have now implemented the requirement for Ajax logins from Hyvä sites.

Default customer section data

Starting with this release, visitors without a session will use default private section data.
This saves an Ajax for each visitor, reducing the server load.
We expect this to work without issues in most cases. For more information, please refer to the documentation on how to configure the default section data.

The search_recommendations and search_suggestions block above the search_result_list on the search results page may need styling after upgrading.

Backward incompatible changes

Node version 16

This release upgrades TailwindCSS to version 3.4.1, which requires node version 16.
Be sure to upgrade to node 16 or newer before upgrading hyva-themes/magento2-default-theme to 1.3.6.

Extra Actions block in mini-cart changed to container

The extra_actions block in the mini-cart is used to render additional checkout options, usually provided by payment methods.
By default, Magento renders these with JavaScript via the section data, to not cache customer-specific data in the full page cache.
Previously, Hyvä rendered the extra_actions block with PHP directly, preventing it from being used with actions that required customer or quote data, like PayPal Express In-Context. This upgrade now renders the extra_actions from the private content data with JavaScript.
For backward compatibility with other server-side rendered content, the extra_actions block is still present on the page, but now is a container. The impact of this change depends heavily on the extensions and customizations present in a store.
Be sure to check the mini-cart extra action buttons after the upgrade.

For details, please refer to merge request #1043.

Order history ship-to name

Previously the billing address company name was rendered in the "Ship-To" column of the customer order history and the recent orders in the account dashboard.
This is mostly useful in a b2b context, while the default-theme is intended for b2c use cases.
The result was that the column was empty for most orders in most shops.
This release changes the behavior to render the shipping address customer name instead.
For b2b shops that want to keep the previous behavior, override the Magento_Sales::order/history.phtml and Magento_Sales::order/recent.phtml templates to instead use

<?= $order->getBillingAddress() ? $escaper->escapeHtml($order->getBillingAddress()->getCompany()) : '&nbsp;' ?>

New translated phrases

The following new phrases were added to the translation dictionary:

%1 item
%1 search results
%1 thumbnail
1 search result
Close panel
Configure %1 on the product page
Error initializing Express Checkout, please try again later or choose a different checkout method.
Play video
The price depends on the chosen options
The price depends on the options chosen on the product page

Support for demo-store, disabled JS and missing browser storage notices

Previously these messages were not displayed on Hyvä, even if enabled in the admin backend.
This may cause the demo-store notice to suddenly display after upgrading if it was enabled by accident.

"This is a demo store. No orders will be fulfilled"

Please check before upgrading that "Content > Design > Configuration > [Your Theme] > Display Demo Store Notice" is set to "No".

Support for video settings from the admin config

The default behavior of the gallery option loopVideo has changed.
Previously, loopVideo was set to true by default, causing videos to loop automatically.
This now defaults to false, and the admin configuration takes precedence. To ensure videos loop automatically, set loopVideo to true in your admin configuration found at "Stores > Configuration > Catalog > Catalog > Product Video"

Anonymized default section data is used for visitors without a session

A potentially backward incompatible change in this release is that section data is dispatched without an Ajax request for visitors without a session, using anonymized default data.
This is a performance improvement we wanted to include in the release, despite it potentially having an impact on a few extensions.
We estimate very few extensions to be affected, if any.

Any extension with frontend code expecting section data always to be populated fully may need to configure the default value for the required section in etc/frontend/di.xml.
For example, the following configuration causes the directory-data section not to be emptied in the default section data, and, the wishlist section data is set to contain an empty items array.

<type name="Hyva\Theme\ViewModel\CustomerSectionData">
    <arguments>
        <argument name="defaultSectionDataKeys" xsi:type="array">
            <item name="directory-data" xsi:type="boolean">true</item>
            <item name="wishlist" xsi:type="string">{"items": []}</item>
        </argument>
    </arguments>
</type>

All other sections that are not explicitly listed will be set to an empty array.

New constructor argument for \Hyva\Theme\ViewModel\ProductList

The class has a new mandatory constructor argument \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig. In case you are extending it the parent constructor call, your derivative class must be also updated accordingly.

Changelogs

Changelogs are available from the CHANGELOG.md in the codebase, or here:

Tooling

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

Known Issues

Please check the GitLab issue tracker for the default-theme and the theme-module for known issues.