Skip to content

Instantly share code, notes, and snippets.

@tvlgiao
Last active November 30, 2022 07:04
Show Gist options
  • Save tvlgiao/284df1e9867cc1cfc3ae08c92bb8f245 to your computer and use it in GitHub Desktop.
Save tvlgiao/284df1e9867cc1cfc3ae08c92bb8f245 to your computer and use it in GitHub Desktop.
eggcartonstore customization

Eggcartonstore Customization

Go to Storefront > Script Manager, click Create a Script, choose:

  • Location on page = Footer
  • Select pages where script will be added = All Pages
    • Script category = Essential
  • Script type = Script

Enter the script below to Scripts contents:

<script type="text/javascript">
    (function() {
        var menuLinks = document.getElementById('menu').getElementsByTagName('a');
        for (var a of menuLinks) {
            var text = a.textContent;
            if (('BLOG' == text) || 'LOCAL HENS' == text) {
                a.setAttribute('target', '_blank')}
            }
    })();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment