$('body').on('click', '[data-essox]', function() {
   const $dataPriceEl = $('[data-price]');
   const $essoxPriceEl = $('[data-price-essox]');

   let variationPrice = null

   if ($essoxPriceEl.length) {
      variationPrice = $essoxPriceEl.data('price-essox');
   } else if ($dataPriceEl.length) {
      variationPrice = $dataPriceEl
         .text()
         .match(/([\d]+[ ,.])*[\d]+/);
      variationPrice = variationPrice[0].replace(' ', '');
      variationPrice = variationPrice.replace(',', '.');
   }

   var temp = $(this)
      .attr('href')
      .split(/[?&]price=/);
   var url = new URL(temp[0], document.location);

   if (variationPrice) {
      url.searchParams.set('price', variationPrice)
   }

   window.open(url, '_blank', 'toolbar=0,resizable=1,status=1,width=830, height=700');
   return false;
});
