to output php variables into a javascript, you need to use opening and closing php tags and the php echo command:
for example:
$TotalPrice
should be:
<?php echo WA_eCart_DisplayMoney($stonehouse, $stonehouse->DisplayInfo("TotalPrice")); ?>
Look at how the variables are displayed on the confirm page, and copy the syntax from there.