Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm getting this console js error:
Uncaught SyntaxError: Unexpected token ',' (at product1?variant=46948594495045:595:20)
It's from a JS file where a field for the chosen_currency isn't filled out with a string:
<script> window.baCurr = window.baCurr || {}; window.baCurr.config = {}; window.baCurr.rePeat = function () {}; Object.assign(window.baCurr.config, { "enabled":false, "manual_placement":"", "night_time":false, "round_by_default":false, "display_position":"bottom_left", "display_position_type":"floating", "custom_code":{"css":""}, "flag_type":"countryandmoney", "flag_design":"modern", "round_style":"none", "round_dec":"", "chosen_cur":, <<-------- HERE "desktop_visible":false, "mob_visible":false, "money_mouse_show":false, "textColor":"", "flag_theme":"default", "selector_hover_hex":"", "lightning":false, "mob_manual_placement":"", "mob_placement":"bottom_left", "mob_placement_type":"floating", "moneyWithCurrencyFormat":false, "ui_style":"default", "user_curr":"", "auto_loc":false, "auto_pref":false, "selector_bg_hex":"", "selector_border_type":"noBorder", "cart_alert_bg_hex":"", "cart_alert_note":"", "cart_alert_state":false, "cart_alert_font_hex":"" },{
That field should be filled out with something like this "":{"USD":"US Dollar (USD)"}" But it's not for some reason.
I uninstalled Currency HOP plugin which auto-changed the currency to the local one, but that didn't solve the error.
What could be causing it?
Thank you.
I know this is old but I just solved this problem.
Change:
"chosen_cur":,
to
"chosen_cur":"",
Completely got rid of the syntax error! I'm using the impact theme so I'm not sure if it's theme specific OR if someone at shopify made a small error in their code while they were writing it.
Let me know if it works!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024