Forums / Built-in Shipping and Payment Modules / Shipping - I need help with subzones

Shipping - I need help with subzones

Views: 619

Results 1 to 1 of 1
22 Jun 2016, 11:03 AM
#1
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Shipping - I need help with subzones

Hi
I had this on zencart 151, but it was not working the 100% the way we wanted.

Basically this is a simple shipping rules:

This country has the mainland and 2 islands. So I've created 2 sub-zones:
One with the mainland "states" or districts
The other one with the islands "states" or districts

All products above 10€ will have a free shipping for the mainland
Bellow 10€ there are 2 shipping values. One for the mainland, other for the islands.

Until now, I've used the ot_shipping -> Allow Free Shipping -> true
But that would allow to all zones...or sub-zones....

Now I'm trying to make this right. So I've set this option to False.

So I'm using the flat and a flat_clone for shipping rules with freeoptions
Enable Free Options Shipping -> Total >=10 -> Zone -> Mainland

First thing: I still have those yellow icons on both modules.

Second: On a order > 10 , if a customer is from the mainland districts he has the 2 options ( and that doesn't make sense ? )

A customer from the islands, will only have one option ( in this case, no freeoptions ).

Now, the only way I can get this the way I want is to add to the flat module code:

 if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
        $check_flag = false;
        $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
      
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1 [B]&& $order->info['total'] < '10'[/B]) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id'] && [B] $order->info['total'] < '10'[/B]) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
        }

But I think I'm not using this right....I mean, this is a simple shipping rule, I shouldn't need to mess with the code ....

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison