<?php
session_start();
include "../admin/database.php" ;
$user_id=NULL;
$user_id=session_id();
$query="SELECT * from temp_cart where user_id='$user_id'";
$rec=db::getRecords($query);
$price=NULL;
if($rec!=null)
{
foreach($rec as $rec2)
{
$product_id=$rec2['product_id'];
$query="SELECT * from product where id='$product_id'";
$product=db::getRecord($query);
$product_price = $rec2['total'];
$price=$price + $product_price;
};
echo "$".$price;
}else{
echo "$0";
}
?>