i'm having issues with the code i wrote up below. basically, when there are x items in the cart, it echoes the text "You have x item(s) in the cart". However, when there are no items, it should echo "You don't have any items in the cart" but instead echoes nothing. What am i doing wrong?
<?php
$array = unserialize($_SESSION['__vm']['vmcart']);
foreach($array->products as $product){
$amount = $product->amount;
if ($amount != 0){ echo "You have $amount item(s) in the cart."; }
else { echo "You don't have any items in the cart."; }
}
?>