money_with_currency Javascript version

Anders_Søgaard
Tourist
11 0 2

Hello.

At my product page it automaticly updates the price upon selection of variant.

But i want it to show the price with currency.

My code is currently:

jQuery('#product-price').html('<span class="product-price">'+ Shopify.formatMoney(variant.price, "{{ shop.money_format }}") + '</span>' );

This code shows the price, WIHTOUT currency.

Developer at Youfront webbureau - https://youfront.dk/
0 Likes
Caroline_Schnap
Shopify Staff
Shopify Staff
5704 1 341

Hi Anders!

Replace with:

jQuery('#product-price').html('<span class="product-price">'+ Shopify.formatMoney(variant.price, "{{ shop.money_with_currency_format }}") + '</span>' );

Let me know how that goes!

Anders_Søgaard
Tourist
11 0 2

Thanks.

Developer at Youfront webbureau - https://youfront.dk/
0 Likes

What is the most updated version in 2021?

SPO - SEO App to research keywords & edit social link preview
0 Likes