most likely the problem is in the order of the code. if the code that displays the cart total occurs on the page before the add to cart code, this could explain the problem.
It could also be that the cart contents just need to be updated before the cart total is written.
Try adding:
$CartName->GetContent();
just be fore the code that outputs the total to refresh the cart.