Total cost alert variable

Stored total cost alert in variable and replaced alert and console.log
strings with variable