Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Skip checkout_shipping and checkout_payment


boxtel

Recommended Posts

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

 

Just worked like a charm for me.

Would be 100% of the line you are pasting BEFORE that he has listed.

You are not getting rid of that line, just make some extra spaces, and paste before it.

Just for safety, make sure you have a blank line above and below the newly pasted code as not to run into or over right any other codes.

 

Good luck.

Link to comment
Share on other sites

  • 1 month later...
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'));
}

For people having trouble with an endless redirect, you could try changing the code to add to
// skip if only 1 payment method available
$payment_module_selections = $payment_modules->selection();
if (sizeof($payment_module_selections) == 1) {
 if (!tep_session_is_registered('payment')) tep_session_register('payment');
 $payment = $payment_module_selections[0]['id'];
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}

and see if that sorts things out.

 

You also might want to double check your session and cookie settings.

 

Another thing to check is that you only have one payment method installed in admin >> Modules >> Payment. If you have more than one enabled, this code will not work. Note that it may not be enough to merely disable the other payment modules. You may have to actually remove them.

Always back up before making changes.

Link to comment
Share on other sites

  • 2 months later...

For people having trouble with an endless redirect, you could try changing the code to add to

// skip if only 1 payment method available
$payment_module_selections = $payment_modules->selection();
if (sizeof($payment_module_selections) == 1) {
 if (!tep_session_is_registered('payment')) tep_session_register('payment');
 $payment = $payment_module_selections[0]['id'];
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}

and see if that sorts things out.

 

You also might want to double check your session and cookie settings.

 

Another thing to check is that you only have one payment method installed in admin >> Modules >> Payment. If you have more than one enabled, this code will not work. Note that it may not be enough to merely disable the other payment modules. You may have to actually remove them.

 

 

 

So am I to understand that the only code changes for a 'no sale' but contact admin email is to do what boxtel said on Feb 4 2006? Does this also not shopw the price of the product?

 

Thanks

 

oz

Link to comment
Share on other sites

  • 5 weeks later...

These codes work great in IE. But in firefox it causes the continue shopping link to disappear in the cart. It is the code in checkout_payment.php that is causing that to happen. When I removed it the continue shopping link re appeared. Is there something I can add to the code to make this work?

 

This is the code I put in:

 

 

// 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'));

}

 

 

just before:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);

Link to comment
Share on other sites

For some reason the continue shopping disappeared in IE too. Is there something else I need to do? I also took the codes out of both checkout_payment and checkout_shipping that I put in there in the first place and now the continue shopping link does not work with that neither.

Can someone help?

 

 

This is all I added below:

 

 

 

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'));

}

Link to comment
Share on other sites

  • 3 months later...

works fine for me but cant get the tax for the shipping to be included in the order total,

if I use 2 shipping options all is good, but when It skips that page it wont add the tax in the total

(only shows tax for the products) the overall total is fine but need to display products+shipping tax in this country of mine :)

 

anyone know how to fix it?

 

thx

Link to comment
Share on other sites

works fine for me but cant get the tax for the shipping to be included in the order total,

if I use 2 shipping options all is good, but when It skips that page it wont add the tax in the total

(only shows tax for the products) the overall total is fine but need to display products+shipping tax in this country of mine :)

 

anyone know how to fix it?

 

thx

Try to use this lines

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']);
$shipping = $shipping_modules->cheapest(); // added by mm 5 2 10
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

Link to comment
Share on other sites

Try to use this lines

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']);
$shipping = $shipping_modules->cheapest(); // added by mm 5 2 10
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

 

wow thank you for the fast answer and for saving the day!!! :D

works perfect!

Link to comment
Share on other sites

  • 2 months later...

Does this work with multi vendor shipping?

 

I have 2 payment forms credit card with cvv2 and paypal.

 

I only use UPS shipping ground.

 

I would like to skip the shipping screen and go strait to payment.

 

Can this be done and if so how, I am a novice and not experienced with code.

Link to comment
Share on other sites

  • 9 months later...

Thanks for the code! Installed it on 2.3 and everything works great.

 

Just added two more mods to checkout_confirmation.php to get rid of "edit" links that will loop customer back to checkout page:

FIND:

 <td><?php echo '<strong>' . HEADING_SHIPPING_METHOD . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

 

REPLACE:

            <td><?php echo '<strong>' . HEADING_SHIPPING_METHOD . '</strong>';
		if ( (tep_count_shipping_modules() > 1) && ($free_shipping != true) ) echo  '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

 

 

 

AND

 

FIND:

           <td><?php echo '<strong>' . HEADING_PAYMENT_METHOD . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

 

REPLACE WITH:

           <td><?php echo '<strong>' . HEADING_PAYMENT_METHOD . '</strong>'; 
		if (tep_count_payment_modules() > 1) echo  '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

Link to comment
Share on other sites

  • 3 weeks later...

Is there some way to get this to work with Discount Coupon Codes? Would it just be a matter of moving the code from the checkout_payment page to the checkout_confirmation page? Since I only have one payment option and one shipping option this works great, but I would also like to be able to offer discounts and the contrib I have installed places the code entry on the payment page, which is now skipped.

 

Any help would be appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

Since this thread originated several years ago, can someone post the confirmed required edit(s) to make this work in 2.3.1? It seems like there were a lot of additional tweaks made that may or may not still be required.

 

Thanks,

Chris

Link to comment
Share on other sites

Since this thread originated several years ago, can someone post the confirmed required edit(s) to make this work in 2.3.1? It seems like there were a lot of additional tweaks made that may or may not still be required.

 

Thanks,

Chris

Link to comment
Share on other sites

  • 1 month later...

Since this thread originated several years ago, can someone post the confirmed required edit(s) to make this work in 2.3.1? It seems like there were a lot of additional tweaks made that may or may not still be required.

 

Thanks,

Chris

 

I can confirm that the original posted additions will work fine on 2.3.1. I think the tweaks were mainly special situations or to change the behavior slightly. I have this done on my checkout_shipping.php page since I only have one shipping method available. I had it on the payment page, but removed it since that is where Discount Coupon Codes puts its thing. All these additions do is load the available options and, if there is only one (i.e. no choice to make), it continues to the next step.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...