Custom checkout form processing - bypass payment and shipping
Ray,
I have a second complete shopping cart system within the admin area of a PowerStore site for internal customers. I have done this before successfully but with both the payment gateways and shipping intact.
What I have now is:
The checkout_form.php page auto completes some fields based on the user logged in while most of the shipping fields have been eliminated and are not needed. In their place are a few new fields that will populate the orders table.
I want to bypass both payment and shipping as these are not needed. Payment and shipping is handled in-house after the order comes through.
So the user clicks the Checkout button on the cart.php page. They are taken to the checkout_form.php page.
This form has mostly read-only data filled in by the logged in user. The user has 3 required select fields (for now) that they must select from and click the Next button. They are taken to the confirm.php page.
They review their order and the click the Submit Order button. Which shoots off an email to both the customer and business, one as a reciept and the other as the purchase order/packing slip. The order is also recorded in the database as usual.
My questions are:
1. I know that I need to add the new fields on the process_transactions.php page in order to store them in the session so they are added to the orders table. Also, I had to add hidden input fields further down the page in the "Other Gateways" form.
Will I need to still add the hidden input fields or can most/all of the payment gateway stuff be eliminated?
2. I still need shipping to be enabled for the front shopping cart for external customers. What do I need to do to bypass the shipping on this second internal system?
Hopefully this makes sense.
----------------
Also, when the user first comes to the checkout_form.php page, it is unformatted like it is missing the template. If you fill the rest of the form and click the Next button you are now on the checkout.php page and the formatting is there. I notice that in cart_editable.php there is this:
<?php
if (isset($_POST['CID'])) {
$_POST['CID'] = trim($_POST['CID']); // trimming due to prevent extra space that may occur during copy and paste
storeCoupons($_POST['CID'],$database_PowerStoreConnection,$PowerStoreConnection);
}
$checkoutRedirect = "checkout_form.php";
?>
If I edit the Redirect to checkout.php it does what I want however, you have to refresh the page otherwise in my dropdowns the options have "Notice: Undefined index:" messages appended to them.
Any ideas of how to avoid this?