Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1
    Join Date
    May 2006
    Posts
    102
    Plugin Contributions
    0

    Default freeoptions shipping method problem

    Hello
    how can I disable all shipping options when I turn on my freeoptions shipping method in the admin.
    time to time we offer shipping value and we want to shut down all other shipping methods automatically as soon as i turn on the "freeoptions shipping method"
    I can add some php code within the shipping method?

    Tanks

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: freeoptions shipping method problem

    What is the criteria of the Free shipping and is it for everyone or just a Zone when that criteria is met?
    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!

  3. #3
    Join Date
    May 2006
    Posts
    102
    Plugin Contributions
    0

    Default Re: freeoptions shipping method problem

    Hello
    thanks for answering. I have several zones in my shop but i want only to one zone. if i do a campaign and activate freeoptions shipping method in the admin, and if its value is €90, all purchases over €90 show only the option free shipping.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: freeoptions shipping method problem

    I have to admit that showing the Free Shipping Options freeoptions when the order is >= 90.00 and the customer is in the right Zone at the same time as the other shipping modules is way easier than trying to turn off all of the other shipping modules and only show this shipping module ...

    Advantage: customer can choose other methods to expedite the shipping and you do not have have to do a heck of a lot of rewritting of the other shipping modules ...

    What other shipping module(s) are you using?
    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!

  5. #5
    Join Date
    May 2006
    Posts
    102
    Plugin Contributions
    0

    Default Re: freeoptions shipping method problem

    shipping modules:
    flat
    flatClone
    PayPal
    flattransf
    freeoptions
    item
    storepickup

    I do not mind making changes shipping modules, i have made ​​many changes in payment modules. if i have the code so i can disconnect the modules...

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: freeoptions shipping method problem

    You need to make a Zone Definition and set the DEFINE for who is allowed the Free Shipping Options freeoptions and set it on that shipping module with the Total >= 90 ...

    Next, look at what the Zone Definition value is in the URL where you will see:
    zID=XX

    Now, say you wanted to customize the Flat Rate flat to turn off for this Zone Definition when the order is >= 90 ...

    You can add the code in RED to do this:
    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) {
                $check_flag = true;
                break;
              } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                $check_flag = true;
                break;
              }
              $check->MoveNext();
            }
    
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
    
    // 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']) >= 90) {
              $this->enabled = false;
            }
          }
    // eof: turn off for over 90 and zone 92
    
        }
    
    // class methods
    Change the 92 to match your zID ...

    Then adapt that to your other shipping modules ...
    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. #7
    Join Date
    May 2006
    Posts
    102
    Plugin Contributions
    0

    Default Re: freeoptions shipping method problem

    thank you very much
    I'll test and then say if it workes.
    thanks again Ajeh

  8. #8
    Join Date
    May 2006
    Posts
    102
    Plugin Contributions
    0

    Default Re: freeoptions shipping method problem

    Quote Originally Posted by Ajeh View Post
    You need to make a Zone Definition and set the DEFINE for who is allowed the Free Shipping Options freeoptions and set it on that shipping module with the Total >= 90 ...

    Next, look at what the Zone Definition value is in the URL where you will see:
    zID=XX

    Now, say you wanted to customize the Flat Rate flat to turn off for this Zone Definition when the order is >= 90 ...

    You can add the code in RED to do this:
    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) {
                $check_flag = true;
                break;
              } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                $check_flag = true;
                break;
              }
              $check->MoveNext();
            }
    
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
    
    // 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']) >= 90) {
              $this->enabled = false;
            }
          }
    // eof: turn off for over 90 and zone 92
    
        }
    
    // class methods
    Change the 92 to match your zID ...

    Then adapt that to your other shipping modules ...
    but tell me, if i put this code in the shipping modules and the module freeoptions is disabled, will the shipping modules Enables if the purchases Total >= 90?

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: freeoptions shipping method problem

    Why would you have the Free Shipping Options freeoptions disabled?

    You need that for orders over 90 and your Zone Definition that you make ...

    If you need to turn off the code based on turning on or off a sales campaign that is giving this Free Shipping for the one zone and whatever the amount is ... you could customize the code further that the 90 amount is an amount that is set in something like the extras directory:
    /includes/extra_configures

    and a file such as:
    extra_shipping_free_options.php

    and set a session variable such as:
    $_SESSION['free_shipping_options_amount'] = 90;

    Then use that in the custom code ...

    When you want to run that off, set the amount from 90 to something like:
    $_SESSION['free_shipping_options_amount'] = 10000;
    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!

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: freeoptions shipping method problem

    Why would you have the Free Shipping Options freeoptions disabled?

    You need that for orders over 90 and your Zone Definition that you make ...

    If you need to turn off the code based on turning on or off a sales campaign that is giving this Free Shipping for the one zone and whatever the amount is ... you could customize the code further that the 90 amount is an amount that is set in something like the extras directory:
    /includes/languages/english/extra_definitions

    and a file such as:
    extra_shipping_free_options.php

    and set a session variable such as:
    $_SESSION['free_shipping_options_amount'] = 90;

    Then use that in the custom code ...

    When you want to run that off, set the amount from 90 to something like:
    $_SESSION['free_shipping_options_amount'] = 10000;

    That should trigger the session variable soon enough for the modules ...
    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!

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Freeoptions shipping module
    By Svanis in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 Dec 2008, 01:49 AM
  2. Problem with adding shipping method
    By kenix in forum Built-in Shipping and Payment Modules
    Replies: 16
    Last Post: 10 Sep 2008, 07:51 PM
  3. Default Shipping Method Problem
    By toeyt in forum Bug Reports
    Replies: 9
    Last Post: 19 Dec 2007, 03:49 AM
  4. Problem with shipping method page
    By ross357 in forum General Questions
    Replies: 4
    Last Post: 25 Apr 2007, 02:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg