Skip to content

Instantly share code, notes, and snippets.

@robisatthefunction
Created August 11, 2025 17:26
Show Gist options
  • Select an option

  • Save robisatthefunction/c50a4c0825069619c4c219690117b62d to your computer and use it in GitHub Desktop.

Select an option

Save robisatthefunction/c50a4c0825069619c4c219690117b62d to your computer and use it in GitHub Desktop.
function getTotalOrderAmount() {
let price = document.querySelectorAll('div > div.a-column.a-span2 > li > div:nth-child(2) > span')
let count = 0
price.forEach(function(element){
let priceString = element.innerHTML.replace('$', '');
let priceFloat = parseFloat(priceString);
count += priceFloat;
});
return count;
}
getTotalOrderAmount();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment