Fraktkostnadskalkulator

For å illustrere våre fraktkostnader, reknar vi dei ut basert på di lokasjon som følgjer. Du kan bruke den oppgitte prisrekneren eller tabellen.

Få Fraktdetaljar

Velg Ditt Land

Shipping

Eller, sjå tabellen over frakt/returkostnader

$(window).on('load', function() { var locale = "no-NO"; var currency = "NOK"; var shippingDataList = []; var shippingDataActive = null; var exchangeRate = 1; var sortDirection = 1; function loadShippingData() { $.getJSON('https://cdn02.plentymarkets.com/6wg68w8zahno/frontend/assets/country-shipping-cost.json', function(data) { shippingDataList = data; populateCountrySelect(); populateShippingTable(shippingDataList); if (currency !== 'EUR') { getCurrencyValue(); } }); } function populateCountrySelect() { var countrySelect = $('#country-select'); countrySelect.empty(); countrySelect.append(''); shippingDataList.forEach(function(item) { countrySelect.append(''); }); } function getCurrencyValue() { var token = 'f627cb0f42-1fb81ebaed-rtnzmr'; $.getJSON('https://api.fastforex.io/fetch-one?from=EUR&to=' + currency + '&api_key=' + token, function(response) { exchangeRate = response.result[currency]; }); } function formatCurrency(price) { return new Intl.NumberFormat(locale, { style: "currency", currency: currency, minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(price * exchangeRate); } function showShippingData() { var selectedCountry = $('#country-select').val(); shippingDataActive = shippingDataList.find(function(item) { return item.country === selectedCountry; }); if (shippingDataActive) { $('#shipping-country-active').show(); if (shippingDataActive.shipping_free_from <= 0) { $('#order-text-1').text('Bestillingar til `country`:'.replace('`country`', shippingDataActive.country)); $('#order-text-2').text(''); } else { $('#order-text-1').text(''); $('#order-text-2').text('Bestillingar under `price` til `country`:'.replace('`price`', formatCurrency(shippingDataActive.shipping_free_from)).replace('`country`', shippingDataActive.country)); } $('#flat-rate-postage').text((shippingDataActive.flat_rate_postage === 0) ? 'Gratis' : formatCurrency(shippingDataActive.flat_rate_postage)); $('#return-cost').text((shippingDataActive.return_cost === 0) ? 'Gratis' : formatCurrency(shippingDataActive.return_cost)); $('#free-shipping').text((shippingDataActive.shipping_free_from > 0) ? 'Legg inn bestillingar over `price` for å nyte gratis frakt'.replace('`price`', formatCurrency(shippingDataActive.shipping_free_from)) : ''); } } function toggleShippingTable() { $('#shipping-data-table').toggle(); var toggleIcon = $('#toggle-icon'); if ($('#shipping-data-table').is(':visible')) { toggleIcon.css('transform', 'rotate(0deg)'); } else { toggleIcon.css('transform', 'rotate(180deg)'); } } function filterCountries() { var searchValue = $('#search-country').val().toLowerCase(); var filteredList = shippingDataList.filter(function(item) { return item.country.toLowerCase().includes(searchValue); }); populateShippingTable(filteredList); } function sortByCountryName() { sortDirection *= -1; shippingDataList.sort(function(a, b) { var countryA = a.country.toUpperCase(); var countryB = b.country.toUpperCase(); if (countryA < countryB) { return -1 * sortDirection; } if (countryA > countryB) { return 1 * sortDirection; } return 0; }); filterCountries(); } function populateShippingTable(data) { var shippingDataBody = $('#shipping-data-body'); shippingDataBody.empty(); if (data.length > 0) { data.forEach(function(item) { var row = $(''); row.append('' + item.country + ''); row.append('' + (item.flat_rate_postage === 0 ? 'Gratis' : formatCurrency(item.flat_rate_postage)) + ''); row.append('' + (item.return_cost === 0 ? 'Gratis' : formatCurrency(item.return_cost)) + ''); row.append('' + (item.shipping_free_from === 0 ? '0' : formatCurrency(item.shipping_free_from)) + ''); shippingDataBody.append(row); }); $('#no-data-found').hide(); } else { $('#no-data-found').show(); } } $('#show-shipping-data').on('click', showShippingData); $('#toggle-shipping-table').on('click', toggleShippingTable); $('#search-country').on('input', filterCountries); $('#sort-by-country').on('click', sortByCountryName); loadShippingData(); });