✦ Verified product
Sunset & Wildflowers
USD 25.00
Iron Gap Wholesale Boutique
Verified independent store
→
function calculateSezzle(){ var priceElement = document.querySelector('#ProductPrice') || document.querySelector('.shopify-buy__product__actual-price'); var includeComma = false; i
f(typeof(priceElement) !== 'string'){ if(priceElement.getElementsByTagName('sup').length && !priceElement.getElementsByClassName('sezzle-delimiter').length){ var delimiterElement = document.createElement('span'); delimiterElement.className = 'sezzle-delimiter'; delimiterElement.style.fontSize = '0px'; delimiterElement.innerText = includeComma ? ',' : '.'; priceElement.insertBefore(delimiterElement, priceElement.querySelector('sup') ); } } priceElementText = typeof(priceElement) === 'string' ? (includeComma ? priceElement.replace('.','') : priceElement.replace(',','')) : (includeComma ? priceElement.textContent.replace('.','') : priceElement.textContent.replace(',','')); var currencySymbol = priceElementText.split('').filter(function(character){ return /[$|€|£]/.test(character)})[0] || '$'; var currentPrice = ''; for(var i=0; i < priceElementText.length; i++){ if(/[0-9()]/.test(priceElementText[i]) || (!includeComma && priceElementText[i] === '.') || (includeComma && priceElementText[i] === ',')){ currentPrice += priceElementText[i]; } } var currentPriceInCents = (currentPrice.replace(',','.'))*100; var installmentPrice = (currentPriceInCents/400).toFixed(2); var formattedInstallmentPrice = priceElementText.indexOf(currencySymbol) > priceElementText.indexOf(currentPrice) ? installmentPrice + currencySymbol : currencySymbol + installmentPrice; return includeComma ? formattedInstallmentPrice.replace('.',',') : formattedInstallmentPrice; } document.onreadystatechange = function(){ document.querySelector('.sezzle-shopify-buy-static-widget').querySelector('.sezzle-payment-amount').innerText = calculateSezzle() && 'of '+calculateSezzle(); }