Forums / Built-in Shipping and Payment Modules / freeoptions shipping method problem

freeoptions shipping method problem

Views: 2,677

Results 21 to 31 of 31
7 Feb 2012, 4:25 PM
#21
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

freeoptions shipping method problem

No, that is meant for the amount ...

You replaced the Zone ...

// bof: turn off for over 90 and zone 92
      if ( ($this->enabled == true) ) {
        $check_flag = false;
        $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . 92 . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
        }
        if ($check_flag == true && ($order->info['total'] - $order->info['shipping_cost']) >= $_SESSION['free_shipping_options_amount']) {
          $this->enabled = false;
        }
      }
// eof: turn off for over 90 and zone 92

Then you can either edit the Free Shipping Options for the Total >= 10000 to turn it off or just REMOVE it when not using it ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 Feb 2012, 4:32 PM
#22
dinix avatar

dinix

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

Re: freeoptions shipping method problem

sorry, I saw what he had done wrong. I think it will work and can work well. tonight I'll test and tell you something. THANK YOU FOR EVERYTHING. Soon I will donate to Zen-cart, tanks to you. there is a problem with the Zen-cart, product group. does not, but I'll open a post for this.

8 Feb 2012, 10:39 AM
#23
dinix avatar

dinix

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

Re: freeoptions shipping method problem

Hello Ajeh the code works, thanks. Only a question would not be possible the code read in the database instead the /includes/languages/english/extra_definitions/extra_free_shipping_options.php??
I go to admin-> Modules-> Shipping and change the field> = can the modules go read this number in the database?

8 Feb 2012, 2:05 PM
#24
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: freeoptions shipping method problem

You can try this with:
MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 2:50 PM
#25
dinix avatar

dinix

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

Re: freeoptions shipping method problem

Ajeh:

You can try this with:
MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN

// bof: turn off for over 90 and zone 92
if ( ($this->enabled == true) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . 92 . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == true && ($order->info['total'] - $order->info['shipping_cost']) >= $_SESSION['MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN']) {
$this->enabled = false;
}
}
// eof: turn off for over 90 and zone 92
like this??

8 Feb 2012, 3:32 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: freeoptions shipping method problem

No ... it is not a session variable it is a constant ... just use it as:
MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 3:32 PM
#27
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: freeoptions shipping method problem

NOTE: if the Free Shipping Options freeoptions is not installed, it will evaluate as 0 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 3:52 PM
#28
dinix avatar

dinix

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

Re: freeoptions shipping method problem

Ajeh:

No ... it is not a session variable it is a constant ... just use it as:
MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN

ok but sorry i´m not to god as php programmer. if i understood a l
leave the modules with your command lines and put the new command in all modules

8 Feb 2012, 4:12 PM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: freeoptions shipping method problem

Where you had the:
90

that was then changed to the:
$_SESSION['free_shipping_options_amount']

you now change to the:
MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN

Now, providing the Free Shipping Options freeoptions is installed with the value of what the amount in that makes it work or the high value of 10000 which would turn it "off" ... it should, in theory work ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 4:28 PM
#30
dinix avatar

dinix

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

Re: freeoptions shipping method problem

ok tanks. Im going to test

8 Feb 2012, 10:45 PM
#31
dinix avatar

dinix

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

Re: freeoptions shipping method problem

Fantastic Ajeh work 100%
tanks men