Why isn't my menu button functioning correctly?

Topic summary

A user’s menu button is malfunctioning on their Shopify store. The issue stems from incomplete or incorrectly copied JavaScript code, likely in the theme.liquid file.

Root Cause:

  • Uncaught SyntaxError due to unclosed brackets in the code
  • Missing or improperly copied JavaScript snippets
  • Code appears related to window.routes, window.theme_variables, and SHTHelper objects

Recommended Fix:

  1. Locate and correct the JavaScript code in theme.liquid
  2. Remove specific code blocks related to vismaAutoivoice.calculator()
  3. Add proper closing syntax including SHTHelper.qde.className modifications and DOMContentLoaded event listener
  4. Verify all brackets are properly closed

Additional Context:

  • The error may be connected to the Visma e-conomic sync app
  • User should manually verify any custom code additions
  • The theme appears to be Blum

Status: The discussion remains open with the original poster asking for clarification on implementation steps.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

This menu button is not working, can someone help me? Here is my shopify URL https://58ad76-2.myshopify.com/

what recently happened to your store>?

Hi @Felix_o

Think you have added some JavaScript code, probably in theme.liquid but you did not copy all the code. Try to find

window.routes = {
        root_url: `/`,
        cart_add_url: `/cart/add`,
        cart_change_url: `/cart/change`,
        cart_update_url: `/cart/update`,
        predictive_search_url: `/search/suggest`,
        cart_url: `/cart`
      };
      
      window.theme_variables = {
        settings: {
          money_format: "{{amount_no_decimals}} kr",
          money_with_currency_format: "{{amount_no_decimals}} SEK",

        }
      }
      var SHTHelper = window.SHTHelper || {};
      SHTHelper.qs = document.querySelector.bind(document);
      SHTHelper.qsa = document.querySelectorAll.bind(document);
      SHTHelper.qid = document.getElementById.bind(document);
      SHTHelper.qde = document.documentElement;

      var SHTLanguage = window.SHTLanguage || {};
      SHTLanguage.cart = {
        ERROR: `There was an error while updating your cart. Please try again.`,
        QUANTITY_ERROR: `You can only add [quantity] of this item to your cart.`,
      };

      SHTLanguage.free_shipping_bar = {
        UNFULFILLED: `You're **[remaining_amount]** away from free shipping`,
        FULFILLED: `Your order qualifies for free shipping`,
      };

      SHTLanguage.product = {
        PRODUCT_ADD_TO_CART: `Add to cart`,
        PRODUCT_SOLD_OUT: `Slutsåld`,
        PRODUCT_UNAVAILABLE: `Otillgänglig`,
        PRODUCT_UNAVAILABLE_WITH_OPTION: `[value] - Unavailable`,
      };
     
    });
  };

  vismaAutoivoice.calculator();
});

There are few closed brackets that are never opened so you get a JS error in the console

Uncaught SyntaxError: Unexpected token '}'     58ad76-2.myshopify.com/:470

Ok thanks, How do I fix it?

@Felix_o

You have to help me out a bit. But the first step to fix the error is changing the following code


to

```markup

But please note, do not copy the complete code. You probably have this in theme.liquid file but there are some liquid variables so just delete

});
  };

  vismaAutoivoice.calculator();
});

and add

SHTHelper.qde.className = SHTHelper.qde.className.replace('no-js', 'js');
      Shopify.designMode && SHTHelper.qde.classList.add('shopify-design-mode');
      var SHTDefer = [];

      document.addEventListener('DOMContentLoaded', function () {
        while (SHTDefer.length) SHTDefer.shift().call();
      });

I did find code in the Blum theme demo, as I am guessing that is your theme. With this JAvaScript error should be fixed and menu and probably some other things should work.

Now about “vismaAutoivoice.calculator();” I really could not find much . JIt might be connected to this app

https://apps.shopify.com/visma-e-conomic-sync

but you should be able to confirm that or maybe you added some custom code manually. I am not sure.