juniorprg Posted February 15, 2007 Share Posted February 15, 2007 I have been looking around in forums i have seen people asking same question but no answers tho. I have 3 payment methods and want to make one as the default method...is this possible I know if there is only 1 payment method, then its assumed to be the default one any help guys? l8ter Link to comment Share on other sites More sharing options...
Guest Posted February 16, 2007 Share Posted February 16, 2007 you have to modify your payment.php class and checkout_payment.php Based upon which module you want to default to you could setup a flag to signal the selection of the radio button. Similar to the way the checkout_shipping.php is. For example in checkout_shipping.php find this: echo tep_draw_radio_field('payment', $selection[$i]['id']); replace it with if( $i == 0 ) $checked = true; else $checked = false; echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked); Of course you need to determine a way to select the default payment from someplace else. Like from the customer's account options page or the payment module options. and backup your files before modifying. Link to comment Share on other sites More sharing options...
juniorprg Posted February 16, 2007 Author Share Posted February 16, 2007 thanks mark, its not very clear but i will have a look at the coding and will get back to you l8ter Link to comment Share on other sites More sharing options...
nvedia Posted February 16, 2007 Share Posted February 16, 2007 Oh enigma1 So this is not possible from the admin of oscommerce? Link to comment Share on other sites More sharing options...
juniorprg Posted February 16, 2007 Author Share Posted February 16, 2007 is there a way without going thru too much fuzz just make the COD payment checked by default for all customers, so that if that mod is actively it will be show as checked... so im think if i can make this do able in catalog\includes\modules\payment\cod.php any ideas how to make this happen l8ter Link to comment Share on other sites More sharing options...
juniorprg Posted February 16, 2007 Author Share Posted February 16, 2007 no osccoder, right now this isnt possible. only if 1 payment is active then by default that payment method is selected l8ter Link to comment Share on other sites More sharing options...
Velveeta Posted February 16, 2007 Share Posted February 16, 2007 no osccoder, right now this isnt possible. only if 1 payment is active then by default that payment method is selected One way to do this without editting much, if I remember correctly, is to just change the sort value on those payment modules in the admin console... I *believe* that whichever module is listed first is always the default, although I don't have my code readily available to double-check that, but enigma's post leads me to think that's right, since it checks if $i == 0, and sets $checked = true, else $checked = false... So if you set the COD module to sort 0 and changed the others to sort below that, COD should always be selected by default... Richard. Richard Lindsey Link to comment Share on other sites More sharing options...
juniorprg Posted February 16, 2007 Author Share Posted February 16, 2007 hey velveeta we meet again! :) oh im dying to try that what you just said, but right now im backing up my system so not able to do anything...but surely will let you guys know l8ter Link to comment Share on other sites More sharing options...
juniorprg Posted February 21, 2007 Author Share Posted February 21, 2007 this worked!! i made the code changes like at checkout_payments.php like this by replacing echo tep_draw_radio_field('payment', $selection[$i]['id']); to the following: if( $i == 0 ) $checked = true; else $checked = false; echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked); and then which ever payment is the lowest in sort order, it was selected by default... thanks guys l8ter Link to comment Share on other sites More sharing options...
juniorprg Posted February 21, 2007 Author Share Posted February 21, 2007 this worked!! i made the code changes like at checkout_payments.php like this by replacing echo tep_draw_radio_field('payment', $selection[$i]['id']); to the following: if( $i == 0 ) $checked = true; else $checked = false; echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked); and then which ever payment is the lowest in sort order, it was selected by default... thanks guys l8ter Link to comment Share on other sites More sharing options...
Guest Posted February 21, 2007 Share Posted February 21, 2007 Oh enigma1So this is not possible from the admin of oscommerce? If you want to go further with this, would be better to modify the account.php or one of the customer account pages in the catalog and have him select the default payment/shipping modules, if he wants of course. That would require couple of extra columns for the customers table to signify the shipping/payment modules Link to comment Share on other sites More sharing options...
Velveeta Posted February 21, 2007 Share Posted February 21, 2007 If you want to go further with this, would be better to modify the account.php or one of the customer account pages in the catalog and have him select the default payment/shipping modules, if he wants of course. That would require couple of extra columns for the customers table to signify the shipping/payment modules And if you want to expand on that idea as well, if they selected a credit card module as their default, you could give them the option of saving their credit card details, and then you could truly have a nearly one-click checkout, once they confirmed their shipping address... Just make sure you store that number in the database in encrypted format, in case the db is ever compromised... Richard. Richard Lindsey Link to comment Share on other sites More sharing options...
Bigredman74 Posted March 5, 2007 Share Posted March 5, 2007 Check out Default Selected Shipping Method Desc: "Choose the shipping method default selected in the checkout_shipping.php page in the shop; not necessarily the cheapest." http://www.oscommerce.com/community/contributions,4396 My Published & Modified Contributions Helpful Forum Topics: Basic Design Tips & Tricks | Simple Steps to Better Forum Searching | Speed / Performance Optimizations Link to comment Share on other sites More sharing options...
Bigredman74 Posted March 5, 2007 Share Posted March 5, 2007 Check out Default Selected Shipping Method Desc: "Choose the shipping method default selected in the checkout_shipping.php page in the shop; not necessarily the cheapest." http://www.oscommerce.com/community/contributions,4396 My Published & Modified Contributions Helpful Forum Topics: Basic Design Tips & Tricks | Simple Steps to Better Forum Searching | Speed / Performance Optimizations Link to comment Share on other sites More sharing options...
mmph Posted March 30, 2008 Share Posted March 30, 2008 Check out Default Selected Shipping MethodDesc: "Choose the shipping method default selected in the checkout_shipping.php page in the shop; not necessarily the cheapest." http://www.oscommerce.com/community/contributions,4396 thanks for the link, I just installed this and it's great. Install was about 10 minutes and it was up an running. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.