Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Pass Header settings to header-drawer snippet #3118

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

Conversation

Roi-Arthur
Copy link
Contributor

PR Summary:

The settings that allow merchants to show or hide country and language selectors in the Header have no effect on the drawer menu, where they always show, as soon as the shop has more than one market and/or more than one language set up.
This can create discrepancies between the mobile and desktop experience, as well as interfere with merchants who might prefer to use apps rather than the default selectors provided.

Additionally, while disabling the settings does not hide the selectors in the drawer menu, it does remove the class header--has-localizations which in turns removes some styling from the selectors.

Why are these changes introduced?

Fixes #2919

What approach did you take?

Passing the existing values for the section.settings.enable_country_selector and section.settings.enable_language_selector settings through to the header-drawer.liquid snippet

Visual impact on existing themes

This change does not introduce visual any major change but will allow for a consistent experience for both the merchant and the site user.

Testing steps/scenarios

Current behavior

  • Step 1 Set up your store so it has at least 2 languages and/or at least 2 markets (not including the default "International" market)
  • Step 2 Install Dawn 12.0.0 on the store
  • Step 4 In the Theme editor, navigate to the settings of Header section, scroll down the see the settings called Enable country/region selector and Enable language selector, and disable both
  • Step 5 Resize the window so that the desktop view navigation collapses into a hamburger menu or switch to mobile view
  • Step 6 Observe the discrepancy between the settings (disabled) and the selectors (visible). Additionally, note that the selectors are missing some left padding (they're flush against the window edge)
localization_selectors_mobile

Proposed behavior

For comparison, repeat same steps with the current branch where settings influence the visibility of the selectors.

localization_selectors_mobile_fixed

Demo links

Checklist

@mpickett-shopify
Copy link

Are we proceeding with any work on this issue? Still occurring in v14, new request to have this removed. However the Files changed on this PR no longer match the code in v14. Will figure out a workaround for this merchant.

@hamzat-hobs
Copy link

hamzat-hobs commented Aug 19, 2024

A temporary workaround I implemented was to change this line of code {%- if localization.available_countries and localization.available_countries.size > 1 -%} to {%- if section.settings.enable_country_selector and localization.available_countries.size > 1 -%} in the header-drawer.liquid snippets folder.

@JustTobinShopify
Copy link

Hey there team! Is this still something that is being planned? Theme Support is still getting escalations to have this removed and having this resolved would help with the support debt it's causing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Country/region selector is still shown in mobile drawer even when it's disabled
5 participants