Skip to content

Instantly share code, notes, and snippets.

@IliasHad
Created December 1, 2020 23:06
Show Gist options
  • Save IliasHad/9076798bd095aa175984cdfa9b6112f8 to your computer and use it in GitHub Desktop.
Save IliasHad/9076798bd095aa175984cdfa9b6112f8 to your computer and use it in GitHub Desktop.
{%- capture contentForQuerystring -%}{{ content_for_header }}{%- endcapture -%}
{%- assign pageUrl = contentForQuerystring | split:'"pageurl":"' | last | split:'"' | first | split:'.myshopify.com' | last |
replace:'\/','/' |
replace:'%20',' ' |
replace:'\u0026','&'
-%}
{%- assign itemShow = '' -%}
{%- for i in (1..1) -%}
{%- unless pageUrl contains "?" -%}{% break %}{%- endunless -%}
{%- assign pageQuerystring = pageUrl | split:'?' | last -%}
{%- assign parts = pageQuerystring | split:'&' -%}
{%- for part in parts -%}
{%- assign keyAndValue = part | split:'=' -%}
{%- if keyAndValue.size > 1 -%}
{% if keyAndValue[0] == param %}{{keyAndValue[1]}}{% endif %}{%- endif -%}{%- endfor -%}{%- endfor -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment