Skip to content

Allow for Hyvä Themes to fall back to regular Magento themes on specific routes.

License

OSL-3.0, Unknown licenses found

Licenses found

OSL-3.0
LICENSE.txt
Unknown
COPYING.txt
Notifications You must be signed in to change notification settings

hyva-themes/magento2-theme-fallback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magento2-theme-fallback

Theme fallback for Hyvä Themes.

What does it do?

It allows the use of the luma theme or define another theme path for specific URLs.

Installation for Hyvä license holders

  1. Install via composer
composer require hyva-themes/magento2-theme-fallback
  1. Enable module
bin/magento setup:upgrade

Installation for contributions or technology partners

  1. Install via composer
composer config repositories.hyva-themes/magento2-theme-fallback git [email protected]:hyva-themes/magento2-theme-fallback.git
composer require hyva-themes/magento2-theme-fallback:dev-main
  1. Enable module
bin/magento setup:upgrade

Magento backend configuration

  1. HYVA THEMES->Theme Fallback->General Settings->Enable

    The configuration path is hyva_theme_fallback/general/enable

  2. HYVA THEMES->Theme Fallback->General Settings->Theme full path

    The configuration path is hyva_theme_fallback/general/theme_full_path

    default frontend/Magento/luma

  3. HYVA THEMES->Theme Fallback->General Settings->The list of URL's parts

    The configuration path is hyva_theme_fallback/general/list_part_of_url

Configuration for Hyvä Checkout

Some sites migrate to Hyvä "Checkout first". Use the fallback configuration /hyva_checkout to match any Hyvä Checkout route for this use case. Be aware that the URL request path in the browser uses /checkout, however, internally the route /hyva_checkout is used.

Using a Hyvä as the fallback theme

Sometimes partial updates are applied to a site, and the Hyvä Theme is configured to be the fallback theme. In this case ESI route needs to be included in the theme fallback configuration, otherwise there may be issues with the navigation not refreshing correctly.

The route that needs to be added to the configuration is page_cache/block/esi.

How does it work?

There is a before-plugin for all frontend controllers. The theme fallback is applied when:

  1. Current route/controller/action path matches to configured part.
    • Example: the configured url is customer/account.
      Then for all requests such as ``customer/account/*` the fallback would be applied.
    • Example: the configured url is customer/account/login. Only for Login page the fallback would be applied.
  2. The part of the current url matches the configured part.
    • Example: the configured url is demo-product.html. All pages with an url containing demo-product.html hold have the fallback.

License

This project is licensed under the Open Software License (OSL 3.0).

  • Copyright: Copyright © 2020-present Hyvä Themes. All rights reserved.
  • License Text: The full text of the OSL 3.0 license can be found in the LICENSE.txt file within this package, and is also available online at http://opensource.org/licenses/osl-3.0.php.

About

Allow for Hyvä Themes to fall back to regular Magento themes on specific routes.

Resources

License

OSL-3.0, Unknown licenses found

Licenses found

OSL-3.0
LICENSE.txt
Unknown
COPYING.txt

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages