shop.money_with_currency_format return null

Highlighted
Excursionist
36 2 1

Hi,

I have some trouble when using object in js.liquid file. Currently, I am watching:

 

 

var currency = {{shop.money_with_currency_format}} // this give blank
var currency = {{shop.money_with_currency_format | json}} // this give me null
var currency = "{{shop.money_with_currency_format }}" // this give me ""

 

 

While in the main page I try like below and it work.

 

<script>
var currency = {{shop.money_with_currency}} // give me ${{amount}}
</script>

 

 

How could I call {{shop.money_with_currency}} inside js.liquid file ?

0 Likes