cloudinary_magento2
cloudinary_magento2 copied to clipboard
Refactor: Use DesignInterface for Hyvä Theme Detection in ProductGalleryHelper
Description:
Overview
This PR updates the ProductGalleryHelper::isHyvaThemeEnabled() method to use DesignInterface instead of ThemeProvider, ensuring accurate detection of Hyvä-based themes, including child themes.
Changes:
-
Replaced
ThemeProviderwithDesignInterfaceto align with\Hyva\Theme\Service\CurrentTheme::isHyva(). -
Updated
isHyvaThemeEnabled()to check parent themes recursively for better Hyvä theme detection. -
Injected
DesignInterfacevia constructor to follow Magento's best practices.
Why This Change?
- Ensures compatibility with Hyvä child themes.
- Matches Hyvä’s official approach to theme detection.
- Reduces direct reliance on
ThemeProviderandScopeConfigInterfacefor theme resolution.
Notes:
-
This change does not affect existing functionality beyond improving Hyvä theme detection.
-
No other parts of the class were refactored to maintain scope.