Markets and consent
Countries, currencies, locations, the market suggestion and the cookie banner.
| Element | What it does |
|---|---|
[consent-condition="sale-of-data"] (template) | Shown only in sale-of-data regions (CSS only). |
[consent-panel="banner"] (template) | Shown while the banner is required, hidden while the preferences panel is open (CSS only). |
[consent-panel="preferences"] (template) | Shown only while the preferences panel is open (CSS only). |
[popover][data-is="market-dialog"] | Suggests the visitor’s market once per browser, opening after a delay and after the cookie banner closes. |
[popover][data-is="market-dialog"] button[data-action="continue"] (template) | Switches to the suggested market when it is not the current one, closes the suggestion and remembers it was seen; with a country-switcher inside the dialog it only closes (the visitor chooses there). Closing the dialog any other way stays on the market. |
button[data-is="preferences-button"] | Opens the preferences panel of the page’s cookie banner; shown only where the consent applies (2.0). |
country-switcher | Lists the market’s countries in a popover and changes country on a pick. The countries are the Shopify markets’ (availableCountries of the localization); the locales are the site’s [locales] a[hreflang] links, else the head’s link[rel=“alternate”][hreflang], and a pick that finds a locale for the country’s ISO code (IT → the Italian page) changes the country, then the language, then goes to that page; without locales or without a matching one only the country changes and the page stays. |
currency-code (template) | Text set to the current currency ISO code, anywhere in the document. With one country the switcher goes; a currency-code outside it still gets the currency (2.0). |
location-switcher | Lists the shop’s pickup locations in a popover and changes location on a pick. |
smootify-consent | Cookie banner and preferences panel built over Shopify’s Customer Privacy API: shown while Shopify asks for consent and the visitor has not answered, the preferences while open. With button[data-is=“preferences-button”] inside (one component, e.g. in the Footer, the banner in a [popover] or [consent-panel]) it stays for the button wherever the consent applies, the banner closed until asked; elsewhere it is hidden whole (2.0). |
smootify-consent [data-action] (template) | Consent buttons (accept all, decline all, save choices, open preferences, close). |
smootify-consent [popover] (template) | Opened and closed with the banner; closed from outside it hides the banner for the page. |
smootify-consent input[type="checkbox"][name] (template) | Consent category checkboxes, mirrored from and saved to the current consent. |