Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor: Use DesignInterface for Hyvä Theme Detection in ProductGalleryHelper #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itaymesh
Copy link

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 ThemeProvider with DesignInterface to align with \Hyva\Theme\Service\CurrentTheme::isHyva().
  • Updated isHyvaThemeEnabled() to check parent themes recursively for better Hyvä theme detection.
  • Injected DesignInterface via 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 ThemeProvider and ScopeConfigInterface for 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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant