Skip checkout_shipping and checkout_payment
#1
Posted 04 February 2006, 08:33
checkout_shipping.php:
just before:
// process the selected shipping method
add:
// bypass if only 1 shipping method available or free shipping
if ( (tep_count_shipping_modules() == 1) || ($free_shipping == true) ) {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
if ($free_shipping) {
$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
$quote[0]['methods'][0]['cost'] = '0';
} else {
$quote = $shipping_modules->quote($method, $module);
}
$shipping = array('id' => $shipping,
'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
'cost' => $quote[0]['methods'][0]['cost']);
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
checkout_payment.php:
just before:
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);
add:
// skip if only 1 payment method available
if (tep_count_payment_modules() == 1) {
if (!tep_session_is_registered('payment')) tep_session_register('payment');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
#2
Posted 12 April 2006, 04:18
When I click on Checkout, I get "page can not be displayed" for checkout_shipping.php.
Any ideas??
Thanks,
Lauren
#3
Posted 13 April 2006, 00:03
#4
Posted 08 July 2006, 17:50
#5
Posted 29 July 2006, 20:41
#6
Posted 03 August 2006, 20:19
#7
Posted 14 September 2006, 03:23
#8
Posted 21 November 2006, 16:46
I skipped the page altogether and set the checkout_payment.php to let you choose shipping address and billing address. But then I do have two payment choices, so that page I need all together.
My header link to checkout now points to checkout_payment.php, as does the shopping cart.
and I altered checkout_payment.php to include the default shipping method.
this solution is more simple, but does have one disadvantage. on the process trail below the links are still displayed that two steps have been completed. The first of those I removed as well.
#9
Posted 23 November 2006, 16:13
Edited by wheeloftime, 23 November 2006, 18:26.
#10
Posted 10 December 2006, 17:07
boxtel, on Feb 4 2006, 08:33 AM, said:
checkout_shipping.php:
just before:
// process the selected shipping method
add:
// bypass if only 1 shipping method available or free shipping
if ( (tep_count_shipping_modules() == 1) || ($free_shipping == true) ) {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
if ($free_shipping) {
$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
$quote[0]['methods'][0]['cost'] = '0';
} else {
$quote = $shipping_modules->quote($method, $module);
}
$shipping = array('id' => $shipping,
'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
'cost' => $quote[0]['methods'][0]['cost']);
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
checkout_payment.php:
just before:
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);
add:
// skip if only 1 payment method available
if (tep_count_payment_modules() == 1) {
if (!tep_session_is_registered('payment')) tep_session_register('payment');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
Thanks, Amanda,
I have used your modification to skip the checkout_payment page. I encountered just one little snag.
I had two payment modules installed, PayPal IPN and the standard PayPal module. I had disabled the latter and so had only one payment choice offered to the customer.
When I applied your mod, after clicking Continue on the Delivery Information page, nothing happened. Instead of going straight to Checkout Confirmation, operation seemed to get stuck in a loop.
I then removing the standard PayPal module instead of just disabling it and all was well. This is not a problem. I don't need the standard module and I can easily re-install it if I ever do.
I haven't tried skipping the delivery page. I wonder if the same point applies here too? That is, that the mod needs to have only one option installed rather than just one enabled.
Tony
#11
Posted 10 December 2006, 17:19
aharpur, on Dec 11 2006, 01:07 AM, said:
I have used your modification to skip the checkout_payment page. I encountered just one little snag.
I had two payment modules installed, PayPal IPN and the standard PayPal module. I had disabled the latter and so had only one payment choice offered to the customer.
When I applied your mod, after clicking Continue on the Delivery Information page, nothing happened. Instead of going straight to Checkout Confirmation, operation seemed to get stuck in a loop.
I then removing the standard PayPal module instead of just disabling it and all was well. This is not a problem. I don't need the standard module and I can easily re-install it if I ever do.
I haven't tried skipping the delivery page. I wonder if the same point applies here too? That is, that the mod needs to have only one option installed rather than just one enabled.
Tony
try using this:
if (tep_count_payment_modules() < 2 ) {
$payment_select = $payment_modules->selection();
$payment = $payment_select[0]['id'];
if (!tep_session_is_registered('payment')) tep_session_register('payment');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
and as far as I can see, only enabled modules count, not just installed modules.
#12
Posted 13 December 2006, 16:11
boxtel, on Dec 10 2006, 05:19 PM, said:
if (tep_count_payment_modules() < 2 ) {
$payment_select = $payment_modules->selection();
$payment = $payment_select[0]['id'];
if (!tep_session_is_registered('payment')) tep_session_register('payment');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
and as far as I can see, only enabled modules count, not just installed modules.
I have tested your mod again (both versions) and you are right. The payment info page is correctly skipped whether the unwanted payment module is removed or just disabled. I don't know what caused the glitch I experienced a few days ago. Must have been something else.
I now intend to use your second version (10 Dec).
Thanks
Tony
#13
Posted 16 January 2007, 08:31
just changed the code slightly:
if ( (tep_count_shipping_modules() == 1) || ($free_shipping == true) ) {
changed to:
if ( (tep_count_shipping_modules() == 0) || ($free_shipping == true) ) {
#14
Posted 27 February 2007, 02:44
/ bypass if only 1 shipping method available or free shipping
if ( (tep_count_shipping_modules() == 1) || ($free_shipping == true) ) {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
if ($free_shipping) {
$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
$quote[0]['methods'][0]['cost'] = '0';
} else {
$quote = $shipping_modules->quote($method, $module);
}
$shipping = array('id' => $shipping,
'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
'cost' => $quote[0]['methods'][0]['cost']);
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
Edited by theantiquestore, 27 February 2007, 02:45.
#15
Posted 17 January 2008, 21:10
"The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
* This problem can sometimes be caused by disabling or refusing to accept cookies."
I have:
Force cookie use - true
SEO URLS
SSL
Any clues?
Solar powered gadgets at down to earth prices.
CheekyNaughty
Promoting British Design
#16
Posted 01 February 2008, 22:38
I thought people should be aware that this happened to me using spu shipping module, authorize.net payment, and STS.
#17
Posted 01 February 2008, 22:42
#18
Posted 10 February 2008, 18:43
Phalen, on Jan 16 2007, 08:31 AM, said:
just changed the code slightly:
if ( (tep_count_shipping_modules() == 1) || ($free_shipping == true) ) {
changed to:
if ( (tep_count_shipping_modules() == 0) || ($free_shipping == true) ) {
The first code I used wasn't skipping but when altering like yourself it worked like a charm. thanks guys
Mike
#19
Posted 20 February 2008, 19:37
I'm using Amanda's code from her first post. However, I changed the first line from:
// bypass if only 1 shipping method available or free shipping
if ( (tep_count_shipping_modules() == 1) || ($free_shipping == true) ) {
To this, because I have two shipping methods...just to see what would happen
// bypass if only 1 shipping method available or free shipping
if ( (tep_count_shipping_modules() == 2) || ($free_shipping == true) ) {
If I login as a customer from the US or Canada and proceed to checkout...it does bypass checkout_shipping and checkout_payment and correctly picks up the calculation for Table Rates as it should.
However, if I login as a customer from France...which is set up on the Zone Rates module...it does not bypass the checkout_shipping screen. Any ideas why Table Rate customers do skip the checkout_shipping page but Zone Rate customers do not?
Actually, I did change the sort order of the two shipping modules so that they both have a sort order of zero, but it made no difference. Can't seem to get foreign buyers to skip the checkout_shipping screen. No big deal...just wondering why that's happening. I know this code was designed for only one shipping method, so...don't yell at me. LOL. Just playing with it and seeing what happens.
Worst case scenario: I can have US and Canada skip 2 steps in checkout and the rest of the planet can skip 1 step. LOL.
Also, I use Credit Class Gift Voucher 5.10. The field to enter any discounts is on the checkout_payment page. Can someone steer me to another contrib where, perhaps, the customer could enter a discount code and redeem from their shopping cart screen...or something close to that? I don't mind losing CCGV at all, but I would like the ability to enter a discount code somewhere. Skipping the checkout_payment screen kills that.
Andrea
#20
Posted 07 October 2008, 17:31
Thanks!














