Hi All.
I am looking at trying to modify this plugin to work as a local delivery module. The Google lookup works lovely and very accurate, in fact to accurate and that's the problem.
My task is to charge in tier groups, example below.
Up to 3 miles = Free
>3 but <5 miles = £2.00
>5 but <7 miles = £5.00
>7 = No Delivery Available
Anyone got any ideas?
Hi, I wrote the original module.
You will need to go into the code and modify it to reflect your tiers, is all. Take for instance, the code from the /includes/modules/shipping/mileageship.php file starting line 50:
Code:
if (MODULE_SHIPPING_MILEAGESHIP_FREEMILES > 0) {
$cost_miles = $info['distance'] - MODULE_SHIPPING_MILEAGESHIP_FREEMILES ;
}
else {
$cost_miles = $info['distance'];
}
Then modify it to have an ElseIf section for each distance you wish to categorize:
Code:
if (MODULE_SHIPPING_MILEAGESHIP_FREEMILES > 0) {
$cost_miles = $info['distance'] - MODULE_SHIPPING_MILEAGESHIP_FREEMILES ;
}
else {
if ($info['distance'] < 3) {
$cost_miles = 0;
} elseif ($info['distance'] < 5) {
$cost_miles = 2;
} elseif ($info['distance'] < 7) {
$cost_miles = 5;
} else {
$shipping_cost = 0;
$error = true;
}
}
Good Luck!
Fjolsvith
Bookmarks