So when I get to the confirm statement, even if I hit cancel when it asks if you're sure you want this, it still prints out the discount, and all of the document.writes even though I do not want it to. If anyone could help it'd be greatly appreciated.

these are a bunch of statements, and since they're just out in the open (not affected by any conditional statements) they are called no mater what. Put them in side a function, and reorganize your code a little. Just a simple logic error