Zen Follower
- Join Date:
- May 2004
- Location:
- UK
- Posts:
- 471
- Plugin Contributions:
- 0
Select table shipping method as default - freedelivery is being set maybe as cheapest
Hi
I have found a number of great posts but none seem to be working out for me
Basically I have 4 shipping modules
FlatClone
FreeSchool (like freedelivery)
storepickup
table
Now for some reason its always defaulting to the "free school delivery" option - which is ONLY available to certain people - I did think that it was triggering the "cheapest" option but I have changed the code in
classes/shipping
$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') {
if (($rates[$i]['cost'] < $cheapest['cost'] and ($rates[$i]['module'] != 'storepickup' && $rates[$i]['module'] != 'flatClone' && $rates[$i]['module'] != 'freeschool' || $size == 1))) {
$cheapest = $rates[$i];
}
} else {
## if ($rates[$i]['module'] != 'storepickup') {
if ($rates[$i]['module'] != 'storepickup' && $rates[$i]['module'] != 'flatClone' && $rates[$i]['module'] != 'freeschool' || $size == 1) {
$cheapest = $rates[$i];
}
}
}
$this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST', $cheapest);
return $cheapest;
}
}
}
(as seen in this thread https://www.zen-cart.com/showthread.php?214470-exclude-shipping-module-from-being-auto-selected-as-cheapest&highlight=shipping+default+cheapest)
but that doesn't seem to do anything - so I am wondering if its NOT looking for cheapest....
I also looked at this thread (https://www.zen-cart.com/showthread.php?216151-Need-to-know-how-to-set-a-default-shipping-option/page2&highlight=shipping+select+default) but as I have more than 1 that didn't help
Any thoughts on where else to try?
Basically I wanted it to - by default - select the TABLE rate shipping method none of the others?
Any pointers would be great thank you
Sarah