CMS Development

ColmK1997
Participant

Pricing Box different currency problem on website

Hi all, on my company website, you can see we  have 3 different pricing licences, in euro, pound and SEK. The euro and pound are changing fine and are the price i need them at but the SEK pricing won't change for me. Bascially I want it to say: 

1. Starter: SEK 44,800

2. Advanced: SEK 141,550

3. Standard: SEK 76,370

 

This is the page that we have: https://www.privacyengine.io/privacy-engine-pricing

 

Can someone help me with this please? I know we have custom HTML but i can't figure out what I need to change to have the right pricing showing. 

Thanks, 

 

0 Votes
2 Réponses
Kevin-C
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Pricing Box different currency problem on website

Hey @ColmK1997 

 

Could you post the code that you're using to create this interactivity?

ColmK1997
Participant

Pricing Box different currency problem on website

Hi Kevin, 

thank you for your reply. 

This is the code:

<script type="text/javascript">
$(document).ready(function(){
$('.testimonials_wrap_v4').parents('.section_wrap').parents('.row-number-1').remove();

var countryCode='';
$.get("https://ipinfo.io", function(response) {
countryCode = response.country;
$("#ddlCurrency").val(countryCode);
if(countryCode == 'GB'){
$('.pricing_table_currency').text('£');
$('.pricing_table_cost:eq(0)').text('4,399');
$('.pricing_table_cost:eq(1)').text('13,899');
$('.pricing_table_cost:eq(2)').text('7,499');
}else if(countryCode == 'US'){
$('.pricing_table_currency').text('$');
$('.pricing_table_cost:eq(0)').text('4,399');
$('.pricing_table_cost:eq(1)').text('13,899');
$('.pricing_table_cost:eq(2)').text('7,499');
}else if(countryCode == 'SE'){
$('.pricing_table_currency').text('SEK');
$('.pricing_table_cost').each(function(){
$(this).text(parseFloat($(this).text()) * parseFloat(10));
$(this).text($(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
});
}else{
$('.pricing_table_currency').text('€');
$('.pricing_table_cost:eq(0)').text('4,399');
$('.pricing_table_cost:eq(1)').text('13,899');
$('.pricing_table_cost:eq(2)').text('7,499');
}
}, "jsonp");

$("#ddlCurrency").on("change",function(){
if($("#ddlCurrency option:selected").val() == "GB"){
$('.pricing_table_currency').text('£');
$('.pricing_table_cost:eq(0)').text('4,399');
$('.pricing_table_cost:eq(1)').text('13,899');
$('.pricing_table_cost:eq(2)').text('7,499');
}else if($("#ddlCurrency option:selected").val() == 'US'){
$('.pricing_table_currency').text('$');
$('.pricing_table_cost:eq(0)').text('4,399');
$('.pricing_table_cost:eq(1)').text('13,899');
$('.pricing_table_cost:eq(2)').text('7,499');
}else if($("#ddlCurrency option:selected").val() == 'SE'){
$('.pricing_table_currency').text('SEK');
$('.pricing_table_cost').each(function(){
$(this).text(parseFloat($(this).text()) * parseFloat(10));
$(this).text($(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
});
}else{
$('.pricing_table_currency').text('€');
$('.pricing_table_cost:eq(0)').text('4,399');
$('.pricing_table_cost:eq(1)').text('13,899');
$('.pricing_table_cost:eq(2)').text('7,499');
}
});
});


</script>

0 Votes