Here is the code snippet that shows what the submit button looks like:
Code: Select all
</fieldset>
<?php } ?>
<div>
<input type="checkbox" name="customer_agreed" id="customer_agreed"> I understand and agree to the <a href="/terms/">terms and conditions</a> of this sale.<br><br>
<input type="submit" name="customer_order_new" id="customer_order_new" value="Submit Order">
</div>
</form>
<?php
}Code: Select all
$cart->saveCart();
if (count($cart->cart_items) > 0) {
$cart->loadItemInfo();
displayCheckoutForm($_POST);
} else {
unset($cart);
header("Location: /");
}
} elseif ((array_key_exists("customer_order_new", $_POST)) && (! empty($_POST["customer_order_new"]))) {
if ((! array_key_exists("customer_agreed", $_POST)) || (strcmp($_POST["customer_agreed"], "on"))) {
echo "<p>You must first agree to the terms and conditions governing the use of this website.</p>\n";
displayCheckoutForm($_POST);
} else {
$custid = 0;
if (! $user->isAuthenticated()) {
if (! empty($_POST["customer_pass1"])) {
if (($cid = $customers->Create($_POST))) {
$custid = $cid;
} else {
echo "<p>" . $_SESSION["msg"] . "</p>\n";
unset($_SESSION["msg"]);
displayCheckoutForm($_POST);
}
}
} else {
$customers->Fetch("customer_user = {$user->user_id}");
$cust = current($customers->customers);
if ($cust) {
$custid = $cust->customer_id;
if (! $customers->Edit($custid, $_POST)) {
echo "<p>" . $_SESSION["msg"] . "</p>\n";
unset($_SESSION["msg"]);
displayCheckoutForm($_POST);
}
} else {
if (($cid = $customers->Create($_POST))) {
$custid = $cid;
} else {
echo "<p>" . $_SESSION["msg"] . "</p>\n";
unset($_SESSION["msg"]);
displayCheckoutForm($_POST);