Shopify themes, liquid, logos, and UX
This menu button is not working, can someone help me? Here is my shopify URL https://58ad76-2.myshopify.com/
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 <b>[remaining_amount]</b> 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?
You have to help me out a bit. But the first step to fix the error is changing the following code
<script>
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 <b>[remaining_amount]</b> 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();
});
to
<script>
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 <b>[remaining_amount]</b> 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`,
};
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();
});
</script>
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.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024