This project is with E-Commerce. There is option to Add to Cart. When user click on add, product will be added to his cart as well and working fine.
For view cart and receive it as mail use this...
In mail use this code...
$tpl_file = 'cartmail.php';
if (!file_exists($tpl_file)) {
die('Mail could not be sent');
exit;
}
$msg_tmpl = file_get_contents($tpl_file);
$to = 'mail@gmail.com';
$subject = 'Enquiry from ' .$_REQUEST['guest_name'];
$message = $msg_tmpl;
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: '.$_REQUEST['email'];
mail($to, $subject, $message, $headers);
And in the cartmail.php
file use this code
Product
Price
Quantity
Total
query("SELECT product_name,product_desc, price FROM products WHERE product_code='$product_code' LIMIT 1");
$obj = $results->fetch_object();
?>
product_name; ?>
price;?>
price*$cart_itm["qty"]; echo $ptotal; ?>
×';?>