Guest Posted June 19, 2007 Posted June 19, 2007 I have two shipping methods but for some reason the one that I don't want to be checked by default gets checked when the page loads. How can control which method is checked by default? Many Thanks in advance. Plamen
Guest Posted June 20, 2007 Posted June 20, 2007 the cheapest shipping method is checked by default. If you want to change this behavior you need to edit your catalog\includes\classes\shipping.php function cheapest().
Guest Posted June 20, 2007 Posted June 20, 2007 the cheapest shipping method is checked by default. If you want to change this behavior you need to edit your catalog\includes\classes\shipping.php function cheapest(). Hi Enigma, My cheapest is £0.00 but it checks the other which is £15.00. Maybe because it's £0.00. Do you have any ideas how I tweak the finction to make it select £0.00 first function cheapest() { if (is_array($this->modules)) { $rates = array(); reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $quotes = $GLOBALS[$class]->quotes; for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) { if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) { $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'], 'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')', 'cost' => $quotes['methods'][$i]['cost']); } } } } $cheapest = false; for ($i=0, $n=sizeof($rates); $i<$n; $i++) { if (is_array($cheapest)) { if ($rates[$i]['cost'] < $cheapest['cost']) { $cheapest = $rates[$i]; } } else { $cheapest = $rates[$i]; } } return $cheapest; } Thanks
Guest Posted June 20, 2007 Posted June 20, 2007 yes change this code: if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) { to if (isset($quotes['methods'][$i]['cost'])){ Here is the complete post about it: http://www.oscommerce.com/forums/index.php?showtopic=220777
Recommended Posts
Archived
This topic is now archived and is closed to further replies.