Hi Everyone,
I've got 2 shipping methods. Pick up and delivery. As of right now, both radio buttons are empty when the customer gets to the shipping screen. I'd like the "delivery" option to default to on. How would I go about doing this?
Thanks!
Hi Everyone,
I've got 2 shipping methods. Pick up and delivery. As of right now, both radio buttons are empty when the customer gets to the shipping screen. I'd like the "delivery" option to default to on. How would I go about doing this?
Thanks!
There is a good reason to have shipping options "un-defaulted"... It forces the customer to make an appropriate choice.
Remember, while customers are nice people, they tend to be rather stupid... They have to be reminded to make the RIGHT choice sometimes!
20 years a Zencart User
The reason that I don't want no radio buttons to be filled in is that if the customer forgets to select an option and hits "next", the same page will reload and no error message will be displayed. Ideally, an error message saying "you forgot to select a shipping method" would pop up. Because this error message doesn't pop up, it may cause the customer to think that the site is bugged and abandon the purchase.
I figured out how to make the most expensive shipping method default to on.
Within shipping.php....
$cheapest = false;
$size = sizeof($rates);
for ($i=0; $i<$size; $i++) {
if (is_array($cheapest)) {
// never quote storepickup as lowest - needs to be configured in shipping module
if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
} else {
if ($rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
}
}
return $cheapest;
change the less than sign that I've colored in red to a greater than sign.
That simple![]()