Location: PHPKode > scripts > Encaps Gallery > encaps-2.3.22s/shopcart_preview.html
<?php 
$cart = new ShopCart($db,$config,$catalog->items);
switch(@$postget['action'])
{
	case "add":$cart->item_add($postget['item_id']);break;
	case "del":$cart->item_delete($postget['item_id']);break;
	case "recalc":$cart->recalc($postget);break;
}
$tpl['items'] = $cart->get_session_items();
?>

<table border=0>
  <tr>
    <td ><table border="0" cellpadding="0" cellspacing="0" width="100%" >
<?php 
$subtotal = 0;
foreach($tpl['items'] as $item_cart)
{
$item_catalog = $catalog->items->get("WHERE id=".$item_cart['id']);
?>
<tr bgcolor="#EFEFEF">
<td valign="top" align="right" style="border:1px solid #FFFFFF; background-color:#F9F9F9 "><?php echo $item_cart['qty']?>&nbsp;x&nbsp;</td>
<td valign="top" style="border:1px solid #FFFFFF; background-color:#F9F9F9 ">$<?php echo sprintf("%.2f",$item_catalog['price']); $total = $item_cart['qty']*$item_catalog['price']; $subtotal += $total?></td>
<td valign="top" style="border:1px solid #FFFFFF; background-color:#F9F9F9 ">&nbsp;<a target="_self" href="catalog.php?id=<?php echo $item_catalog["id"]?>" ><?php echo $item_catalog['title']?></a></td></tr>
<?php }?>
</table>

Sub-Total: <b>$<?php echo sprintf("%.2f",$subtotal)?></b>
</td>
  </tr>

</table>
Return current item: Encaps Gallery