raingart / Aliexpress Total (sums price + delivering)

This is my attempt to apply your solution on another website:

//regex = '/^\s*\n/gm'
// .replace(regex, '');

function sumUp() {
//sumUp = (function sumUp(){
//sumUp = (function(){
// Uncaught TypeError: sumUp is not a function

  let
    tag, fee, sum;

  const
    // /questions/1183903/regex-using-javascript-to-return-just-numbers
    regex = /[-]{0,1}[\d]*[.]{0,1}[\d]+/g,
    prices = [],
    selectors = [
      '.a-price-whole',
      '.a-price-fraction',
      '.a-size-base.a-color-secondary',
      ],
    priceConfig = {
      minimumFractionDigits: 2,
      maximumFractionDigits: 2
      };

  for (let i = 0; i < selectors.length; i++) {
    try {
      prices[i] = document
        .querySelector(selectors[i])
        .textContent
        .trim();
    } catch {
      console.log(`No ${selectors[i]}`);
    }
  }

  tag = prices[0] + prices[1];
  tag = tag.match(regex).join('');
  tag = parseFloat(tag);
  fee = parseFloat(prices[2].match(regex).join(''));

  sum = tag + fee
  // Method .toFixed(2) might be preferable. See raingart.
  sum = sum.toLocaleString(navigator.language, priceConfig);

  priceSum = document.createElement('span');
  priceSum.style.fontWeight = 'bold';
  priceSum.style.padding = '6px';
  priceSum.style.margin = '20px';
  priceSum.style.outline = 'auto';
  priceSum.innerHTML = `∑${sum}`;
  document.querySelector('.priceToPay > span:nth-child(2)').append(priceSum);

  //for (const val of document.querySelectorAll('.a-price-whole')) {
  //  val.innerHTML = `${sum}<b>∑</b><sup><sup>(<sup>$</sup>${tag} + <sup>$</sup>${fee})</sup></sup>`;
  //}

//})();
}

sumUp()

/*
// define the target node
var targetNode = document.querySelector('.a-price-whole');
// configuration of the observer
const config = { childList: false, characterData: true, subtree: true, attributes: false, };

// callback function
const callback = function (mutationsList, observer) {
  console.log('Changes Detected');
  if (!targetNode.outerText.includes(' + ')) {
    sumUp();
  }
};
// Create observer instance
const observer = new MutationObserver(callback);

// pass in the target node and configuration observer.observe(targetNode, config);
observer.observe(targetNode, config);
*/

const observerConfig = { childList: false, characterData: true, subtree: true, attributes: false, };
new window.MutationObserver(sumUp).observe(document.querySelector('.a-price-whole'), observerConfig);

Sorry for the late reply. Sites (openuserjs.org) don't notify me of new posts if I'm logged in via github