Emailing an order form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lostinthecode
Forum Newbie
Posts: 15
Joined: Fri Oct 08, 2010 1:33 pm
Location: Fort Smith, Arkansas
Contact:

Emailing an order form

Post by lostinthecode »

Hey guys, this was touched briefly on my last post but I think the thread is dead, I need help trying to make the order form on my website email the order instead of sending it to our credit card processing system.

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
}
Here is the snippet that shows where customer_order_new gets called:

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);
Thanks in advance for any help.
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: Emailing an order form

Post by greyhoundcode »

But what is the problem, or what is it you wish to improve upon?
Post Reply