SamyT Posted May 20, 2007 Share Posted May 20, 2007 I'm implementing a $0.50 payment method for use under strict circumstances, however when I put this in place the shipping page always defaults to this choice... is there any way to stop it from doing this? I see in the code: $shipping = $shipping_modules->cheapest(); Does anyone know if it's this bit of code that needs changing and what I can change it to so it stops defaulting to the cheapest shipping method. Link to comment Share on other sites More sharing options...
Guest Posted May 20, 2007 Share Posted May 20, 2007 I'm implementing a $0.50 payment method for use under strict circumstances, however when I put this in place the shipping page always defaults to this choice... is there any way to stop it from doing this? I see in the code: Does anyone know if it's this bit of code that needs changing and what I can change it to so it stops defaulting to the cheapest shipping method. If you want a complete hack in catalog\includes\classes\shipping.php change if ($rates[$i]['cost'] < $cheapest['cost']) { to if ($rates[$i]['cost'] > $cheapest['cost']) { at around line 122 Link to comment Share on other sites More sharing options...
SamyT Posted May 21, 2007 Author Share Posted May 21, 2007 Thanks Coopco, pretty sure you're running these forums almost single handedly LOL Link to comment Share on other sites More sharing options...
esearing Posted June 13, 2007 Share Posted June 13, 2007 You can also pick the rate you want to preselect by choosing the position in the array. catalog\includes\classes\shipping.php if ($rates[$i]['cost'] < $cheapest['cost']) { add >> $xi = 0; // or $xi = $i - 1; change>> $cheapest = $rates[$xi]; } the shipping price array follows the radio buttons on the shipping checkout page from top to bottom. example if you have table rate as your first choice then that is array value 0 ($xi = 0;). If you want the next to last value in the array (which may be the lowest of 7 UPS rates returned) then you want $xi = $i - 1 This will be come more complex based on the shipping choices you sellect and the order you put them in. Link to comment Share on other sites More sharing options...
JeanLuc Posted November 9, 2007 Share Posted November 9, 2007 You can also have look to Default Selected Shipping Method Regards JeanLuc OsC: MS2 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.