I've been going through the code for the checkout flow, and I noticed that it could easily be modified to skip step 1 and step 3.
In a situation where a store only allows one address per customer, and only has one (or dosn't let the customer pick) shipping option,
these seem pointless. Step 1 simply because no information is altered, and Step 3 because frankly it might be sort of pointless in any case,
and certainly if you would only be confirming one page of input, Step 2. I could see people forgetting what options were selected on Step 1,
but not really Step 2. ANYHOW...
I would very much like some input from the ZC experts. What problems would I face? What additional alterations would I have to make
in order to not break the basic structure of zen cart, and its various underlying processes?
Below are the alterations I've made so far. This works, and there are no obvious problems that I can se. Everything looks like it should.
I've not done extensive testing, nor checked the database logs from notifier trace. That would be my next step.
Any hints or pointers would be greatly appreciated.
Added above row 239 in /includes/modules/pages/checkout_shipping/header_php.php
PHP Code:
//
// I did not know the usual content_type so I negated virtual instead.
//
if ($order->content_type != 'virtual') {
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
Commented out row 34 in /includes/modules/pages/checkout_payment/header_php.php
PHP Code:
// if no shipping method has been selected, redirect the customer to the shipping method selection page
if (!$_SESSION['shipping']) {
// zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
Commented out row 41 in /includes/modules/pages/checkout_confirmation/header_php.php
PHP Code:
// if no shipping method has been selected, redirect the customer to the shipping method selection page
if (!$_SESSION['shipping']) {
// zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
Added above row 171 in /includes/modules/pages/checkout_confirmation/header_php.php
PHP Code:
// if payment method has been selected, redirect the customer to the checkout process page
if ($_SESSION['payment']) {
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'));
}