Add To Cart
//Reset Variable to Zero
$Shipping = 0;
$GST = 0;
$PST = 0;
$All_Shipping = 0;
$All_PST = 0;
$All_GST = 0;
$All_Name = "";
$All_Desc = "";
$All_Desc_Short = "";
$GrandTotal = 0;
$PShipping = 0;
$PGST = 0;
$PPST = 0;
$PTax = 0;
$MShipping = 0;
$MGST = 0;
$MPST = 0;
$M_Shipping = 0;
$M_GST = 0;
$M_PST = 0;
$MTotal = 0;
//Retrieve Passing Variable
$Region = stripslashes($c);
$PayType = stripslashes ($p);
$Province = stripslashes($pr);
//If no information is passed, default to credit card and payment type.
if($Region == ""){
$Region="o";
}
if($PayType == ""){
$PayType="cc";
}
$P_ID = $_POST['P_ID'];
$T_ID = $_POST['T_ID'];
$O_ID = $_POST['O_ID'];
$All_ID = $_POST['All_ID'];
$P_Name = $_POST['P_Name'];
$Moneris_Name = $_POST['P_Name'];
$P_Desc = $_POST['P_Desc'];
$P_Desc_S = $_POST['P_Desc_S'];
$P_Amt = $_POST['P_Amt'];
$O_Shipping = $_POST['O_Shipping'];
$C_Shipping = $_POST['C_Shipping'];
$BC_Shipping = $_POST['BC_Shipping'];
$U_Shipping = $_POST['U_Shipping'];
$PST = $_POST['PST'];
$GST = $_POST['GST'];
$ColourCode = $_POST['ColourCode'];
$HRE_Finish = $_POST['finish'];
$HRE_Finish_CC = $_POST['HREcc'];
$HRE_Cap = $_POST['cap'];
$GFG_Finish = $_POST['GFGfinish'];
$ASFlag= $_POST['ASFlag'];
$curSessionID = session_id();
if(strlen($ColourCode) >0){
$P_Desc = $P_Desc." Colour Code: ".$ColourCode;
$P_Desc_S = $P_Desc_S." Colour Code: ".$ColourCode;
$Moneris_Name = $Moneris_Name." Colour Code: ".$ColourCode;
}
if(strlen($HRE_Finish) >0){
if(($HRE_Finish!="CustomColour")&&($HRE_Finish_CC =="(Enter Code)")){
$HRE_Finish_CC="";
}
$P_Desc = $P_Desc." -Finish: ".$HRE_Finish." ".$HRE_Finish_CC;
$P_Desc_S = $P_Desc_S." -Finish: ".$HRE_Finish." ".$HRE_Finish_CC;
$Moneris_Name = $Moneris_Name." -Finish: ".$HRE_Finish." ".$HRE_Finish_CC;
if($HRE_Finish == "CustomColour"){
$P_Amt = $P_Amt + 100;
}
}
if(strlen($HRE_Cap) >0){
$P_Desc = $P_Desc." -Cap: ".$HRE_Cap;
$P_Desc_S = $P_Desc_S." -Cap: ".$HRE_Cap;
$Moneris_Name = $Moneris_Name." -Cap: ".$HRE_Cap;
if($HRE_Cap == "Vehicle-Logo"){
$P_Amt = $P_Amt + 125;
}
}
if(strlen($GFG_Finish) >0){
$P_Desc = $P_Desc." -Finish: ".$GFG_Finish;
$P_Desc_S = $P_Desc_S." -Finish: ".$GFG_Finish;
$Moneris_Name = $Moneris_Name." -Finish: ".$GFG_Finish;
}
//Insert new Item
if($P_ID != ""){
if (isset($_SESSION['Cart'][$curSessionID][$P_ID])){
$qty = $_SESSION['Cart'][$curSessionID][$P_ID]["Qty"] + 1;
}else{
$qty = 1;
}
//if (count($_SESSION['Cart'][$curSessionID]) <9){
$_SESSION['Cart'][$curSessionID][$P_ID]= array(
"ID"=>$All_ID,
"MName"=>$Moneris_Name,
"Name"=>$P_Name,
"Desc"=>$P_Desc,
"DescS"=>$P_Desc_S,
"Qty"=>$qty,
"Price" => $P_Amt, //Unit Price
"O_Shipping"=>$O_Shipping,
"BC_Shipping"=>$BC_Shipping,
"C_Shipping"=>$C_Shipping,
"U_Shipping"=>$U_Shipping,
"PST"=>$PST,
"GST"=>$GST
);
}
//}else{
//Display message--Cart can only hold 9 items at a time.
//echo count($_SESSION['Cart'][$curSessionID]);
//echo " |