Page 1 of 1

VirtueMart cart calculation

Posted: Wed May 30, 2007 10:00 am
by Joe
I have been making some edits to virtuemart on joomla and I have encountered a slight problem that I cannot work around. Basically I am trying to display the amount of products that exist in the cart... I use the following code to print the session:

Code: Select all

echo '<pre>Session:<br>';
  print_r($_SESSION);
  echo '</pre>';
And I am resulted with the following:
Session:
Array
(
[cart] => Array
(
[idx] => 2
[0] => Array
(
[quantity] => 4
[product_id] => 1
[description] =>
)

[1] => Array
(
[quantity] => 1
[product_id] => 2
[description] =>
)

)
What I am trying to do is count all the values within the [ quantity ] part, so in this case, it would total upto 5... any ideas on how to do this?.

Thanks![/quote]