More Variables in Cart Array
<p>I'm studying how to code a shopping cart.  Here's my first attempt, which works (no html layout yet; just testing):</p>

<pre><code>session_start();
$_SESSION['test_cart'];

$product_id = $_POST['productid'];
$qty = $_POST['qty'];
$c_exp = $_POST['coupon_expiration']; // This is the third element that I want in 'test_cart' array which I also want to cart show in cart

$product_id = $_POST['productid'];
$quantities = $_POST['qty'];

$_SESSION['test_cart'][$product_id] = $qty;

foreach($_SESSION['test_cart'] as $products =&gt; $quantity)
{
echo " Product: $products --- Quantity: $quantity &lt;br/&gt;";
}
</code></pre>

<p>As you see in the comment, what I need to do is have a third variable ($c_exp) in the 'test_cart' array which I want to echo-out/show in the cart. So each iteration (every product item that user selects to add to cart) would be a TRIFECTA of *productID, quantity, coupon_expiration*.</p>

<p>I've searched for two days and all the tutorials show only FOREACH value pairs, just like my sample code.</p>

<p>How can I achieve what I need?</p>

<p>Thanks in advance.</p>
