//debugger;
let price = $('.productView-price .price.price--withoutTax').text().trim();
var priceVal = $('.productView-price .price.price--withoutTax').text().trim();
// Check whether or not the user is clicking on the same element twice in a row
// If dealing with a price range rather than a specific product price
if ( priceVal.indexOf(' - ') !== -1 ){
var dashIndex = priceVal.indexOf(' - ');
var eurPriceNumOne = parseFloat(priceVal.substr(1, dashIndex).replace(/,/g, '.'));
var eurPriceNumTwo = parseFloat(priceVal.substr((dashIndex + 4), priceVal.length).replace(/,/g, '.'));
var postTaxEurPriceNumOne = parseFloat((((eurPriceNumOne * 1.21) * 100) / 100).toFixed(2)).toFixed(2);
var postTaxEurPriceNumTwo = parseFloat((((eurPriceNumTwo * 1.21) * 100) / 100).toFixed(2)).toFixed(2);
price = '€' + postTaxEurPriceNumOne.replace('.', ',') + ' - ' + '€' + postTaxEurPriceNumTwo.replace('.', ',');
} else {
var eurPriceNum = parseFloat(priceVal.substr(1, priceVal.length).replace(/,/g, '.'));
var postTaxEurPriceNum = parseFloat((((eurPriceNum * 1.21) * 100) / 100).toFixed(2)).toFixed(2);
price = '€' + postTaxEurPriceNum.replace('.', ',');
};
if( sessionStorage.lastBundlePrice ){
if( priceVal !== sessionStorage.lastBundlePrice ){
sessionStorage.lastBundlePrice = price;
$('.productView-price .price.price--withoutTax').text(price);
};
} else {
sessionStorage.lastBundlePrice = price;
$('.productView-price .price.price--withoutTax').text(price);
};
console.log(price);
$("#orgPrice").text(price);