Using that corrected code (in your last post), you must not output the variable
$result_allweight, but you must output the variable
PHP Code:
$result_allweight['total']
see if that works outputting that variable in the template instead.
You can also remove those comments;
PHP Code:
/*
$result_allweight['total']
*/
They were just an instruction to tell you what I said above in this post.