Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / Disable Auto Selection of Payment in checkout - how ?

Disable Auto Selection of Payment in checkout - how ?

Locked
This thread is locked. New replies are disabled.
12 Oct 2006, 3:22 PM
#1
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Post #1 by dogtags

If there is only one payment option, zen automatically selects it, there is no radio button

I want to disable this feature so that each customer must actively select whatever payment option, even if only a single payment option, so that they are clear about what is happening.

There have been a few times where a customer will say that they couldn't find the way to pay. They might not have read the payment dialogue that is displayed when only a single payment method is available.

Would anyone know how I could do this (so that the customer must select their payment choice each time)?

Many thanks :-)

12 Oct 2006, 3:34 PM
#2
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Post #2 by dogtags

[timed out]

Looks like it has something to do with the following code in /includes/classes/payment.php. Would I just comment this stuff out?

// if there is only one payment method, select it as default because in
      // checkout_confirmation.php the $payment variable is being assigned the
      // $_POST['payment'] value which will be empty (no radio button selection possible)
      if ( (zen_count_payment_modules() == 1) && (!isset($_SESSION['payment']) || (isset($_SESSION['payment']) && !is_object($_SESSION['payment']))) ) {
        if (!$credit_covers) $_SESSION['payment'] = $include_modules[0]['class'];
      }

      if ( (zen_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) {
        $this->form_action_url = $GLOBALS[$module]->form_action_url;
      }
12 Oct 2006, 4:39 PM
#3
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Post #3 by seethrou

Although the topic below with something different, may be it have info for reference.
Pre-Select A Payment Option at check-out?.

.

A New Starter again

12 Oct 2006, 9:07 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

tpl_checkout_payment_default.php

  if (sizeof($selection) > 1) {

Set that to 0 in both places.

and then
/includes/classes/payment.php
comment this line, like this:```
// if (!$credit_covers) $_SESSION['payment'] = $include_modules[0]['class'];

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Oct 2006, 2:54 PM
#5
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Post #5 by dogtags

Excellent - thanks so much, Dr :-)