Zen Cart Logo
Forums / General Questions / How to set default radio button for payment?

How to set default radio button for payment?

Views: 4,240

Results 1 to 19 of 19
30 Mar 2010, 10:21 PM
#1
merclord avatar

merclord

New Zenner

Join Date:
Mar 2010
Posts:
14
Plugin Contributions:
0

How to set default radio button for payment?

I have my cart configured for 3 different payment options:
#1 credit card
#2 Paypal (standard)
#3 check/money order

I want the radio button for the credit card option (sort order #0) to be automatically checked the first time a user reaches this page. Anyone know where I can do this? I would imagine it's in the code somewhere...

Mark Hueston
X-cream

30 Mar 2010, 10:34 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: How to set default radio button for payment?

When the customer clicks inside the Credit Card fields to enter their credit card details, it will automatically select the radio button next to that option for them. There's no need to select a "default".

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

22 Apr 2011, 8:03 PM
#3
olivus avatar

olivus

New Zenner

Join Date:
Oct 2008
Posts:
10
Plugin Contributions:
0

Re: How to set default radio button for payment?

I have the same issue that no radio button deault is checked even when customers fill out the credit card info. To make matters worse, the card number disappears forcing them to re-enter their card number again. I have complaints about this and want to set the radio button default to credit card.

I have version 1.3.8a with Authorizenet_aim and Paypal IPN payment modules.

Why won't the radio button get checked on my site at www . olivus . us ???

How do I set a default option ???

22 Apr 2011, 9:59 PM
#4
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: How to set default radio button for payment?

Never had that problem with 1.38a, but now running 1.39 and it works just like The Doc said. Once the customer click inside the CC field it will be auto selected.

22 Jun 2011, 8:22 AM
#5
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,843
Plugin Contributions:
17

Re: How to set default radio button for payment?

Just discovered today that this does not work with Authorize.Net or Merchant partners. Perhaps this was part of the old CC that was removed?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

22 Jun 2011, 8:27 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: How to set default radio button for payment?

dbltoe:

Just discovered today that this does not work with Authorize.Net or Merchant partners. Perhaps this was part of the old CC that was removed?
Not sure what you're talking about.
The auto-select-the-radio-button feature works just fine for all built-in payment modules (including Authorize.net) and for any that were modeled after them.

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

22 Jun 2011, 8:26 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,843
Plugin Contributions:
17

Re: How to set default radio button for payment?

One instance is with a Merchant Partners add-on that was cloned from an earlier Authorize.Net example. I will need to see if the newer authorizenet files are different from what was used as the model for the MP in use. It's been four years so nothing could have changed, right?:P

The other is on a 1.3.9h site with Authorize.Net BUT it does use a TM template.:censored:

Hopefully, I'll have more time to look at it later today. There is an old workaround to force the button with the lowest sort order to be selected, but I would prefer to have the code outside that particular tpl file.

Thanks for the heads up.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

15 Aug 2011, 5:30 PM
#8
britneycook avatar

britneycook

New Zenner

Join Date:
Oct 2010
Posts:
53
Plugin Contributions:
0

Re: How to set default radio button for payment?

DrByte:

Not sure what you're talking about.
The auto-select-the-radio-button feature works just fine for all built-in payment modules (including Authorize.net) and for any that were modeled after them.

Hi Dr. Byte

Ive been struggling a bit with this. I have installed

  1. Paymex Payment module
  2. Bank Deposit
  3. Paypal

when i change the order to bank deposit as #1 it seems to select it as the default but as soon as i change it back to Paymex ###### default, it doesnt seem to pre-select.
Any Ideas on whats Up????

15 Aug 2011, 5:42 PM
#9
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,659
Plugin Contributions:
0

Re: How to set default radio button for payment?

That seems to indicate the Paymex module has the problem.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

15 Aug 2011, 6:08 PM
#10
britneycook avatar

britneycook

New Zenner

Join Date:
Oct 2010
Posts:
53
Plugin Contributions:
0

Re: How to set default radio button for payment?

Kim:

That seems to indicate the Paymex module has the problem.

any ideas where to start?

21 Oct 2011, 12:06 AM
#11
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: How to set default radio button for payment?

1.3.7 would select the radio button for the credit card when you start typing the card number, i am testing with 1.3.9h and it does not do that, is it a bug or am i missing something?

21 Oct 2011, 2:14 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: How to set default radio button for payment?

You must be missing something, because out-of-the-box v1.3.9 also auto-selects the radio button when you start typing.

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

21 Oct 2011, 3:13 PM
#13
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: How to set default radio button for payment?

DrByte:

You must be missing something, because out-of-the-box v1.3.9 also auto-selects the radio button when you start typing.

Thanks DrByte,

I am in away relieved that i missed something rather than it is a bug, i can see the onfocus="methodSelect('pmt-cc')" in the source code in all the credit cards fields.

I checked for the file that has this function and it is present on the computer /includes/modules/pages/checkout_payment, also since i am able to see this effect with another site (1.3.7) i know that java script is enabled.

The only way i can select the radio button for the credit card without directly clicking on it is by clicking anywhere on the label "Credit Card".

Any suggestion to what could be missing? I have the site on a server and i can PM you the IP address to see what i am talking about if you think that would help. Thanks.

Zen Cart 1.3.9h

21 Oct 2011, 3:28 PM
#14
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: How to set default radio button for payment?

I forgot to mention that i am using the Fast and Easy Checkout add on.

10 May 2012, 7:20 PM
#15
apogeerockets avatar

apogeerockets

Zen Follower

Join Date:
Aug 2011
Posts:
104
Plugin Contributions:
0

Re: How to set default radio button for payment?

The SecurePayCOM payment module had the same problem, where people would click in the boxes, enter their information but the payment module would never actually select.. I've compared back and forth between the SecurePayCOM and AuthorizenetAIM modules and figured out the problem. If you open up the authorizenet_aim.php file in the payment modules and go to line 182, you'll find this line of code: ```php
$onFocus = ' onfocus="methodSelect('pmt-' . $this->code . '')"';


On each of the "fields" in your $selection array you will also have to enable the onfocus function.

```php
'field' => zen_draw_input_field('authorizenet_aim_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'id="'.$this->code.'-cc-owner"'. $onFocus . ' autocomplete="off"'),

make sure any 'field' => you have in that array has $onFocus listed in the parameters, and it's best to add in the autocomplete="off" parameter as well.

26 Jun 2012, 10:55 PM
#16
texpro avatar

texpro

New Zenner

Join Date:
Mar 2005
Posts:
16
Plugin Contributions:
0

Re: How to set default radio button for payment?

I see this is an older thread. I don't see where anyone actually solved the problem of the Payment Type radio button being set as a default in 1.3.9. I have two types of payment options on my store and neither radio box is selected at checkout. If the customer enters their credit card information in to the number field still the radio box doesn't select. I have had many orders sent to me without credit card numbers as a result of people not physically selecting the box and thinking because they entered their cc number it would automatically be ok. In the old version 1.3.7 this used to be automatic when you entered the number in the cc box. Does anyone know why this option no longer works, or what can be done to have the Credit Card radio box set as the default? Thanks in advance for your input.

26 Jun 2012, 10:58 PM
#17
drbyte avatar

drbyte

Sensei

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

Re: How to set default radio button for payment?

Your problem will be caused by either or both of the following:
a) your tpl_checkout_payment_default.php template is missing important content and/or the jscript code for the checkout_payment page is missing or damaged or tampered with
b) your payment module is outdated and doesn't contain the required logic to output the needed tags for the logic to work

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

26 Jun 2012, 11:04 PM
#18
texpro avatar

texpro

New Zenner

Join Date:
Mar 2005
Posts:
16
Plugin Contributions:
0

Re: How to set default radio button for payment?

Hi DrByte

Thanks for your reply. I am using ceon_manual_card.php in my 1.3.9 cart. Should I download the original tpl_checkout_payment_default.php file and compare it to the one I am using as a first measure?

26 Jun 2012, 11:12 PM
#19
drbyte avatar

drbyte

Sensei

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

Re: How to set default radio button for payment?

That's a start. I would suggest you deal with both issues I mentioned.

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