Jump to content



Photo
- - - - -

How to change default shipping method radio button?


This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1   NewBudda

NewBudda
  • Members
  • 288 posts

Posted 31 March 2009 - 23:32

I would liek to change the default shipping method. At the moment I offer 2 different ones and the wrong one is selected by default. (radio button) I found this code in the checkout_shipping.php file:
<?php
		} else {
		  for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
			$checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);

			if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
			  echo '				  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
			} else {
			  echo '				  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
			}
?>
What do I need to change to get the other shipping method to be the default one?
If you know the answer could you also let me knwo how it works or how i can find out more about php?

Thank you in advance!
Open Source Newsletter: PhPList
Open Source Questionnaire: Lime Survey

#2   NewBudda

NewBudda
  • Members
  • 288 posts

Posted 17 April 2009 - 19:52

Any ideas? I only want to have the default shipping method set to the other...
Open Source Newsletter: PhPList
Open Source Questionnaire: Lime Survey

#3   krdito

krdito
  • Members
  • 92 posts

Posted 23 May 2012 - 17:03

I am searching for the answer to this question as well and hope someone will respond. This same question has been posted several times, but no answers yet : (

#4   joli1811

joli1811

    Anybody seen this leprechaun say yeah !!

  • Community Sponsor
  • 2,135 posts

Posted 23 May 2012 - 18:35

Hi,
You can change the sort order in admin/modules/shipping( if there is a 0 entered anywhere he will always be the default)
John
To improve is to change; to be perfect is to change often.

#5   krdito

krdito
  • Members
  • 92 posts

Posted 23 May 2012 - 18:43

I only have one shipping module (USPS), so changing the sort order in admin/modules/shipping is not applicable because there is only one choice.

Within the USPS module, I offer 3 shipping options: Parcel Post, Priority Mail, and Express Mail. The current default is parcel post since it is the cheapest. I would like to change the default to be Priority Mail, regardless of cost, but can't figure out how make the radio button for Priority Mail to be the default. Thanks!

Edited by krdito, 23 May 2012 - 18:47.