Skip to content

Instantly share code, notes, and snippets.

View driespieters's full-sized avatar

Dries Pieters driespieters

View GitHub Profile
@driespieters
driespieters / section.liquid
Created December 20, 2022 11:16
Shopify - Conditionally show/hide section based on country
{%- liquid
assign geo_block = false
assign country_match = false
assign markets_isocodes = section.settings.markets_isocodes | split: ','
if markets_isocodes contains localization.country.iso_code
assign country_match = true
endif
if section.settings.markets == "hide" and country_match == true and request.design_mode == false
assign geo_block = true
elsif section.settings.markets == "show" and country_match == false and request.design_mode == false