Skip to content

Instantly share code, notes, and snippets.

@chikaibeneme
Last active March 6, 2020 15:33
Show Gist options
  • Select an option

  • Save chikaibeneme/85577ce9b49292365365dcbb4d77f4c2 to your computer and use it in GitHub Desktop.

Select an option

Save chikaibeneme/85577ce9b49292365365dcbb4d77f4c2 to your computer and use it in GitHub Desktop.
//Add to theme.liquid file before </body> tag
<script>
if(Storage !== undefined) {
var defaultLink = "/collections/all";
{% if template contains 'collection' %}
sessionStorage.collection = "{{ collection.url }}";
{% endif %}
{% if template contains 'cart' %}
if( !sessionStorage.collection ) {
sessionStorage.collection = defaultLink;
}
$(".continue-shopping").attr('href',sessionStorage.collection);
{% endif %}
}
</script>
//menu-cart.liquid
<a href="javascript:void(0)" class="info_btn continue-shopping"><span class="fa fa-chevron-left"></span>{{ 'cart.general.continue_browsing' | t }}</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment