fahiemoto
-
Posts
1 -
Joined
-
Last visited
Never
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Session in email (e-commerce)
in PHP Coding Help
Posted
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?
$ses_quan
$ses_id
$item["artikel_soort"]
$item["artikel_naam"]
$cur_symbol."".number_format($item["artikel_prijs"], 2, '.', '');
$cur_symbol."".number_format($subtotal, 2, '.', '');
?>[!--colorc--][/span][!--/colorc--]
the items from the cart are displayed with the following (fragment) code:
<?
include "functies_winkelwagen.php";
$totalvalue = 0;
session_start();
// If no sessions has been started $_SESSION["cart"] equals null, thus showing the message no items.
if (!isset($_SESSION["cart"])) {
$_SESSION["cart"] = NULL;
}
if (validate() == TRUE && $_SESSION["cart"] != NULL) {
foreach ($_SESSION["cart"] as $key => $session_data) {
list($ses_id, $ses_quan) = $session_data;
// call database connect function
db_connect();
$sel_products = mysql_query("SELECT * FROM $mysql_tablename WHERE artikel_code=".$ses_id."");
$item = mysql_fetch_array($sel_products);
$totalvalue = $totalvalue + ($item["artikel_prijs"]*$ses_quan);
$subtotal = ($item["artikel_prijs"]*$ses_quan);
?>
[!--coloro:#33CC00--][span style=\"color:#33CC00\"][!--/coloro--]<tr bgcolor="#FFFFFF" class="style32" >
<td class="style32"><? echo $ses_quan; ?>
<input name="eid[]" type="hidden" id="eid[]" value="<? echo $ses_id; ?>"></td>
<td class="style32"><!--DWLayoutEmptyCell--> </td>
<td class="style32"><span class="style15"><? echo $item["artikel_naam"]; ?></span></td>
<td colspan="2" class="style32"><span class="style15"><? echo $cur_symbol. "".number_format($item["artikel_prijs"], 2, '.', ''); ?></span></td>
<td width="91" class="style32"><div align="right"><span class="style15"><? echo $cur_symbol. "".number_format($subtotal, 2, '.', ''); ?></span></div></td>
<td bgcolor="#FFFFFF" class="dividingborder"><!--DWLayoutEmptyCell--> </td>[!--colorc--][/span][!--/colorc--]
</tr>
<?
} // end foreach loop
} elseif ($_SESSION["cart"] == NULL) {
echo "woo";
} else {
echo "woohoohoo";
}
?>
the email (fragment) code is as followed:
<?
$content_webmaster = "
Bedrijfsnaam: ".$_SESSION['bedrijfsnaam']."
Naam: ".$_SESSION['naam']." ".$_SESSION['naam']."
Contactpersoon:".$_SESSION['bedrijfsnaam']."
Adres: ".$_SESSION['straat']." ".$_SESSION['straat_nr']." ".$_SESSION['straat_tv']."
".$_SESSION['postcode']." ".$_SESSION['plaats']."
======================================================================
Test:
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]IN HERE I WANT THE CONTENT OF THE CART[!--colorc--][/span][!--/colorc--]
======================================================================
======================================================================
Note: ".$_SESSION['naam']." stuurde deze email op ".date("d-m-Y")." om ".date("H:i").".
Het IP adres van ".$_SESSION['naam']." is: ".$ipadres."
Het hostadres van ".$_SESSION['naam']." is: ".$hostmask."
======================================================================";
?>