I am trying to add up custom fields from different posts. The array I created is not working.
Here is the code.
<?php $totalpricearray = query_posts('post_type=items&author='.$thisauthorID.'&tag='.$thispostID); while (have_posts()) : the_post();
$productprice = get_post_meta($post->ID, "productprice", true);
$productquantity = get_post_meta($post->ID, "productquantity", true);
$totalproductprice = ($productprice * $productquantity);
echo $totalproductprice, ',';
endwhile;
$totalprice = array($totalpricearray);
echo array_sum($totalprice); ?>
Any ideas,
Marvellous
(ps just noticed array is working but equals 0)