You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a site for a client that wants to have products that is purchased from a website to be sent to his email address and then have his eft details sent with a invoice number back to the client's email.
The cart page is working perfectly, I am just struggling to get the content onto the checkout.php/send-email.php page and have all information sent to the owner of the site's email address. I have tried setting up the mailing code but no email gets sent and when it get's sent it doesn't display any information.
Code is as follows:
/////////////////////////////
add-to-cart.php
/////////////////////////////
array("item_id" => $pid, "quantity" => 1));
} else {
// RUN IF THE CART HAS AT LEAST ONE ITEM IN IT
foreach ($_SESSION["cart_array"] as $each_item) {
$i++;
while (list($key, $value) = each($each_item)) {
if ($key == "item_id" && $value == $pid) {
// That item is in cart already so let's adjust its quantity using array_splice()
array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $pid, "quantity" => $each_item['quantity'] + 1)));
$wasFound = true;
} // close if condition
} // close while loop
} // close foreach loop
if ($wasFound == false) {
array_push($_SESSION["cart_array"], array("item_id" => $pid, "quantity" => 1));
}
}
header("location: cart.php");
exit();
}
?>
= 100) { $quantity = 99; }
if ($quantity < 1) { $quantity = 1; }
if ($quantity == "") { $quantity = 1; }
$i = 0;
foreach ($_SESSION["cart_array"] as $each_item) {
$i++;
while (list($key, $value) = each($each_item)) {
if ($key == "item_id" && $value == $item_to_adjust) {
// That item is in cart already so let's adjust its quantity using array_splice()
array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $item_to_adjust, "quantity" => $quantity)));
} // close if condition
} // close while loop
} // close foreach loop
}
?>
Your shopping cart is empty";
?>
';
// Start the For Each loop
$i = 0;
foreach ($_SESSION["cart_array"] as $each_item) {
$item_id = $each_item['item_id'];
$sql = mysqli_query($con,"SELECT * FROM products WHERE id='$item_id' LIMIT 1");
while ($row = mysqli_fetch_array($sql)) {
$product_name = $row["name"];
$price = $row["price"];
$details = $row["description"];
$img = $row['img1'];
$amount = $row['amount'];
$rgb = $row['rgb'];
$ing = $row['ingredients'];
}
$pricetotal = $price * $each_item['quantity'];
$cartTotal = $pricetotal + $cartTotal;
setlocale(LC_MONETARY, "en_US");
// Dynamic Checkout Btn Assembly
$x = $i + 1;
$pp_checkout_btn .= '
';
// Create the product array variable
$product_id_array .= "$item_id-".$each_item['quantity'].",";
// Dynamic table row assembly
$cartOutput .= "";
$cartOutput .= '' . $product_name . ' ';
$cartOutput .= '' . $details . '';
$cartOutput .= 'R' . $price . '.00';
$cartOutput .= '
Change
';
//$cartOutput .= '' . $each_item['quantity'] . '';
$cartOutput .= '' . $pricetotal . '';
$cartOutput .= 'X';
$cartOutput .= '';
$i++;
}
setlocale(LC_MONETARY, "en_US");
$cartTotal = "
Good day,
I am currently working on a site for a client that wants to have products that is purchased from a website to be sent to his email address and then have his eft details sent with a invoice number back to the client's email.
The cart page is working perfectly, I am just struggling to get the content onto the checkout.php/send-email.php page and have all information sent to the owner of the site's email address. I have tried setting up the mailing code but no email gets sent and when it get's sent it doesn't display any information.
Code is as follows:
array("item_id" => $pid, "quantity" => 1)); } else { // RUN IF THE CART HAS AT LEAST ONE ITEM IN IT foreach ($_SESSION["cart_array"] as $each_item) { $i++; while (list($key, $value) = each($each_item)) { if ($key == "item_id" && $value == $pid) { // That item is in cart already so let's adjust its quantity using array_splice() array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $pid, "quantity" => $each_item['quantity'] + 1))); $wasFound = true; } // close if condition } // close while loop } // close foreach loop if ($wasFound == false) { array_push($_SESSION["cart_array"], array("item_id" => $pid, "quantity" => 1)); } } header("location: cart.php"); exit(); } ?> = 100) { $quantity = 99; } if ($quantity < 1) { $quantity = 1; } if ($quantity == "") { $quantity = 1; } $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $i++; while (list($key, $value) = each($each_item)) { if ($key == "item_id" && $value == $item_to_adjust) { // That item is in cart already so let's adjust its quantity using array_splice() array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $item_to_adjust, "quantity" => $quantity))); } // close if condition } // close while loop } // close foreach loop } ?> Your shopping cart is empty"; ?> '; // Start the For Each loop $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $item_id = $each_item['item_id']; $sql = mysqli_query($con,"SELECT * FROM products WHERE id='$item_id' LIMIT 1"); while ($row = mysqli_fetch_array($sql)) { $product_name = $row["name"]; $price = $row["price"]; $details = $row["description"]; $img = $row['img1']; $amount = $row['amount']; $rgb = $row['rgb']; $ing = $row['ingredients']; } $pricetotal = $price * $each_item['quantity']; $cartTotal = $pricetotal + $cartTotal; setlocale(LC_MONETARY, "en_US"); // Dynamic Checkout Btn Assembly $x = $i + 1; $pp_checkout_btn .= ' '; // Create the product array variable $product_id_array .= "$item_id-".$each_item['quantity'].","; // Dynamic table row assembly $cartOutput .= ""; $cartOutput .= '' . $product_name . '/////////////////////////////
add-to-cart.php
/////////////////////////////
'; $cartOutput .= '' . $details . ''; $cartOutput .= 'R' . $price . '.00'; $cartOutput .= ' Change '; //$cartOutput .= '' . $each_item['quantity'] . ''; $cartOutput .= '' . $pricetotal . ''; $cartOutput .= 'X'; $cartOutput .= ''; $i++; } setlocale(LC_MONETARY, "en_US"); $cartTotal = "
/////////////////////////////
<title>Your Cart</title>cart.php
/////////////////////////////
//////////////
send-email.php
/////////////
////////////////
<title>Vape elicious</title>checkout.php
////////////////
Checkout
Please fill out the following information in order to complete your order.
*Required fields
The text was updated successfully, but these errors were encountered: