Just bumping this as, although it was 'solved', I need a variation of the code.
Basically, xelawho's code above works fine if there are no other empty divs on the page, but when there are it's placing the points total in them. So what I need is for the script to ONLY put the calculated points total in to the div with the class "points".
Does that make sense?
If you think of a row of products, and underneath each product image there are two boxes. One box has the price in it and has a class "price", the other box is where the worked out loyalty points go and has a class of "points". I need it to calculate the points total from the price box and display the points in the points box.
Thanks in advance for all your help. It's almost there!