Hi,
Sorry if this is the wrong thread to post this in ...
I've been playing with free shipping for a new site and have encountered a couple of problems (which I think I've now solved).
I need to offer free shipping for certain products only and only to certain areas (in this case Australia). Setting them as "Free Shipping" does the trick, but only locally. If I want to be able to send them O/S but charge postage then I want the ozpost module to kick in and work it out.
What I found is that if I ONLY select free shipping products then the ozpost module is never even run.
If I have a mixture of free and paid shipping products then it is and works things out correctly for the free zone (AUS).
If I have a mixture and want to send O/S ozpost still considers the free ones to be free and ignores them.
I've figured out where the ozpost module is disabled when ALL products are free (includes/functions/functions_general.php) and tweaked that so that other modules are no longer disabled when all products are free.
The next step is to make ozpost include the free products when the destination is not in the free zone.
By inserting a bit of code from the freeshipper module that does its zone checking into ozpost and adding an extra condition to the free shipping check I believe it has the desired result (testing seems to give the right sort of output).
Now the ozpost module kicks in no matter what and gives a cost for O/S postage for every product, even if it's set to free locally. It ignores locally free products and gives a cost for charged ones and still doesn't show up at all if ALL products are fee and sent locally.
It's not perfect in that I want to give slightly discounted international post for the locally free items, but I can do that by manipulating their weights (it'll end up close enough).
I'm not sure if this is a modification you'd want to include, Rod, (especially as it also requires modifying another file outside ozpost) but it's a possible idea to add to the list (you're probably sick of me wanting changes after I beat you over the head for weeks with the SkippyPost bit ). Even if it's not something to be included, it might help someone else or maybe somebody can come up with a better or more comprehensive solution.
Here's what I added to ozpost.php (around line 546)
Code:
if ((int)MODULE_SHIPPING_FREESHIPPER_ZONE > 0) {
$check_flag = true;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FREESHIPPER_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = false;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = false;
break;
}
$check->MoveNext();
}
}
if ((($type->fields['product_is_always_free_shipping'] == 0) && ($type->fields['products_virtual'] == 0)) || $check_flag) {
Bookmarks