Forums / Templates, Stylesheets, Page Layout / Code help, pls - how do I reverse the order of these 2 radio buttons?

Code help, pls - how do I reverse the order of these 2 radio buttons?

Locked

Views: 945

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
29 Jan 2010, 3:29 PM
#1
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Code help, pls - how do I reverse the order of these 2 radio buttons?

These codes are from tpl_checkout_payment_default.php, showing the two radio buttons for the two payment methods.

I would like Paypal to come before credit cards ... but fiddling with these codes have not generated desired result like some other occasions.

Could somebody help me? I have zero php (or any) programming capability. Just doing guess work.

Thank you!

<?php } ?> <?php $radio_buttons = 0; for ($i=0, $n=sizeof($selection); $i<$n; $i++) { ?> <?php if (sizeof($selection) > 1) { if (empty($selection[$i]['noradio'])) { ?> <?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?> <?php } ?> <?php } else { ?> <?php echo zen_draw_hidden_field('payment', $selection[$i]['id']); ?> <?php } ?>

<label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label>

29 Jan 2010, 3:31 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

Don't touch the code!!!!!!!

Just change the sort-order of the modules in Admin->Modules->Payment.

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

29 Jan 2010, 3:32 PM
#3
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

My God! Thank you, DrByte!

29 Jan 2010, 3:41 PM
#4
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

Now, I need to change the default button selection from 2CO to PayPal Express ... because the latter is on top now. I better not touch any code now !

But I can't find it in the Admin - Payment Modules ...

Or, I am thinking perhaps I should leave both radio buttons unselected, and let the customer make a selection (but does not allow the customer to go forward if the selection is not made) ... is this easily achievable?

29 Jan 2010, 4:24 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

In a brand new clean install of Zen Cart, if more than one option is available, there are NO payment modules automatically-selected by default. That choice is left ENTIRELY up to the customer.

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

30 Jan 2010, 2:08 AM
#6
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

Thank you, DrByte.

I could not possibly have "intentionally" customised the Zencart to do the default selection. I have only PayPal Express and 2CO installed for payment. And now 2CO is selected by default. Does this mean that it is the 2CO (ZC Add-on) codes that I should investigate for this issue? Could anyone farmiliar with this part of the codes help?

30 Jan 2010, 2:32 AM
#7
Kim avatar

Kim

Obaa-san

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

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

Does this mean that it is the 2CO (ZC Add-on) codes that I should investigate for this issue? Could anyone farmiliar with this part of the codes help?

I would suggest you check the support thread for that module.

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.

30 Jan 2010, 3:59 AM
#8
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Re: Code help, pls - how do I reverse the order of these 2 radio buttons?

Thank you, both DrByte and Kim.

I would just like to clear the false alarm I created. It turned out that the reason one radio button is checked is because my test viewing is still in the same session, and that earlier during the same session, I have checked that radio button. In such case, whenever I come back to this page, it "remembers" the selection.

This is actually logical, clever, and NOTHING WRONG.

I discovered this just now when I was told my session has expired and I went to checkout fresh.

Sorry for confusion created.

Jeff