Why is the 'chosen_currency' field in my JS file not being filled out?

onlyup
New Member
4 0 0

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.

Reply 1 (1)

alexze
Shopify Partner
1 0 0

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!