Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 2 votes

Skip checkout_shipping and checkout_payment


39 replies to this topic

#1 boxtel

  • Community Member
  • 5,237 posts
  • Real Name:amanda
  • Location:Taipei, Taiwan

Posted 04 February 2006, 08:33

Skip checkout_shipping and checkout_payment if they have only 1 option for selection.


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'));
}
Treasurer MFC

#2 hutt5

  • Community Member
  • 33 posts
  • Real Name:Lauren

Posted 12 April 2006, 04:18

I tried this and it's not working for me...
When I click on Checkout, I get "page can not be displayed" for checkout_shipping.php.

Any ideas??

Thanks,
Lauren

#3 enigma1

  • Community Member
  • 8,206 posts
  • Real Name:Mark Samios

Posted 13 April 2006, 00:03

and what happens when someone uses a single credit card payment gateway? Is it going to loop forever?

#4 streetflossin

  • Community Member
  • 249 posts
  • Real Name:Ryan
  • Location:New Jersey

Posted 08 July 2006, 17:50

Just wondering anyone got this working?

#5 jasper12

  • Community Member
  • 32 posts
  • Real Name:John Collin

Posted 29 July 2006, 20:41

I've tried the skip checkout_payment.php (just another click that I don't need) and it works beautifully - right on cue as I was about to ask someone how to do it. Many thanks!!!!!

#6 streetflossin

  • Community Member
  • 249 posts
  • Real Name:Ryan
  • Location:New Jersey

Posted 03 August 2006, 20:19

still dont work for me

#7 indianking

  • Community Member
  • 28 posts
  • Real Name:Jason

Posted 14 September 2006, 03:23

works like a charm. A Zillion thanks to you.

#8 jdvb

  • Community Member
  • 450 posts
  • Real Name:Jonathan

Posted 21 November 2006, 16:46

nice solution you chose,
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 boxtel

  • Community Member
  • 5,237 posts
  • Real Name:amanda
  • Location:Taipei, Taiwan

Posted 23 November 2006, 16:13

:thumbsup:

Edited by wheeloftime, 23 November 2006, 18:26.

Treasurer MFC

#10 aharpur

  • Community Member
  • 8 posts
  • Real Name:Tony Harpur

Posted 10 December 2006, 17:07

View Postboxtel, on Feb 4 2006, 08:33 AM, said:

Skip checkout_shipping and checkout_payment if they have only 1 option for selection.
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 boxtel

  • Community Member
  • 5,237 posts
  • Real Name:amanda
  • Location:Taipei, Taiwan

Posted 10 December 2006, 17:19

View Postaharpur, on Dec 11 2006, 01:07 AM, said:

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


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.
Treasurer MFC

#12 aharpur

  • Community Member
  • 8 posts
  • Real Name:Tony Harpur

Posted 13 December 2006, 16:11

View Postboxtel, on Dec 10 2006, 05:19 PM, said:

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.

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 Phalen

  • Community Member
  • 83 posts
  • Real Name:tanya

Posted 16 January 2007, 08:31

great stuff! just wanted to skipp the shipping page, seeing as i dont use that at all - my site is just for magazine subscriptions - so no shipping needed at all.

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 theantiquestore

  • Community Member
  • 584 posts
  • Real Name:Rachael
  • Gender:Female

Posted 27 February 2007, 02:44

I couldnt seem to get it to skip the checkout_payment page to work with the newer google checkout contrib. Since I dont offer any type of shipping options (flat rate on one site, table on another) I just put this code in checkout_shipping.php and didnt put anything in checkout_payment to bypass the whole thing and go straight to the confirmation page.

/ 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 digilee

  • Community Member
  • 594 posts
  • Real Name:Lee

Posted 17 January 2008, 21:10

I've just tried to get this working but all I get is
"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?
SolarFrenzy
Solar powered gadgets at down to earth prices.

CheekyNaughty
Promoting British Design

#16 magicmycote

  • Community Member
  • 45 posts
  • Real Name:MM

Posted 01 February 2008, 22:38

I applied this edit to my checkout_shipping and checkout_payment (1 shipping option, 1 payment option available). I'm using the Authorize.net module, but when they would enter an incorrect cc#, or a wrong cvv code or any general address error that would cause the order to be declined - the error messages were not being displayed. Instead, the page would refresh and go right back to the checkout_confirmation page. So users would click confirm 5 or 6 times and give up...then check their bank account and sometimes find they were pre-charged 5 or 6 times.

I thought people should be aware that this happened to me using spu shipping module, authorize.net payment, and STS.

#17 magicmycote

  • Community Member
  • 45 posts
  • Real Name:MM

Posted 01 February 2008, 22:42

Also when this hack is applied, the bottom order status "line" (payment information --- confirmation ---- finished , etc) does not line up (dot is over finished on confirmation page) when used in conjunction with the Authorize.net module (new one).

#18 navyhost

  • Community Member
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 10 February 2008, 18:43

View PostPhalen, on Jan 16 2007, 08:31 AM, said:

great stuff! just wanted to skipp the shipping page, seeing as i dont use that at all - my site is just for magazine subscriptions - so no shipping needed at all.

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
Sincerely
Mike

#19 puggybelle

  • Community Member
  • 897 posts
  • Real Name:Andrea
  • Gender:Female
  • Location:Central North Carolina

Posted 20 February 2008, 19:37

I have two shipping methods available. Table Rates for the US and Canada...and Zone Rates for other countries.

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 callenords

  • Community Member
  • 63 posts
  • Real Name:Carl Nordström
  • Gender:Male
  • Location:Sweden

Posted 07 October 2008, 17:31

If it gets stuck in a loop (the page can't be displayed... etc) try to remove and install the payment and shipping modul in the Admin section.

Thanks!