Page 6 of 6 FirstFirst ... 456
Results 51 to 60 of 60
  1. #51
    Join Date
    Jul 2009
    Location
    California
    Posts
    18
    Plugin Contributions
    0

    Default Limit Priority Mail Flat Rate Options by Order Total

    I've searched everywhere for this with no luck. I am using the USPS shipping module. Currently I only offer First Class or Priority Mail shipping. I would like to be able to offer various Flat Rate Boxes shipping options but I need to set some limits on them. I can't ship a large order in just a Small Flat Rate box.

    What I want to do is actually limit these options based on the Order Total (not order weight). Is this possible?

  2. #52
    Join Date
    Jul 2009
    Location
    California
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping Module Programming Question

    Well, for #1, what I did already does show that. And yes, if you're smart you'd choose Free Shipping not the other shipping methods. But there's the occasional weird shopper that want's to KNOW they've paid for Priority mail or whatever. But like I said, with what you showed in post #39 - it already accomplished my goal #1 and #3.

    The only issue remaining is the #2 - the mixed cart.
    But if I add a NON Free Shipping of 0.10 lbs ... I get:
    USPS for 0.10lbs
    That's what I want, but in my tests, that's not happening. If I add a free shipping item of 1.5 lb I get the Free Shipping Option and the Priority Mail option of about $10.

    BUT, if I add a non-free shipping item of another 1.7 lb to that, I now do not see the Free Shipping Option (which is correct), but the Priority Mail Option shows $16 (the price for 3+ lbs., not just the 1.7 lb it should be). This is the part that isn't correct. The cart should show shipping costs for ONLY the 1.7 lb non-free shipping item.

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

    Default Re: Shipping Module Programming Question

    Make sure ALL Products have weight to them ...

    For Products with Free Shipping to the US, mark those as:
    Always Free Shipping

    To have it so that a shopping cart of:

    1 ALL Always Free Shipping
    Free Shipping
    USPS for FULL weight of Always Free Shipping

    2 MIXED Cart
    USPS for weight of ONLY Products NOT Always Free Shipping

    3 International
    USPS for FULL weight regardless of Always Free Shipping


    Try this ...

    Make your Zone Definition for the US and check what it's zID is in the URL ... that number should be used where you see the 21 for the:
    Code:
            $valid_zone_id = 21;
    to your zID ...

    edit the file:
    /includes/classes/shipping.php

    and use this code in RED:
    Code:
      function calculate_boxes_weight_and_tare() {
        global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
    
    // bof: allow 1 zone only for Always Free Shipping
    //echo '<br>Starting weight: ' . $total_weight . '<br>';
        global $db, $order, $cart;
            $valid_zone_id = 21;
            $check_flag = false;
            $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . $valid_zone_id . "' 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 not valid_zone_id
            if ($check_flag == false) {
              $total_weight += $_SESSION['cart']->free_shipping_weight;
    //echo 'International ' . $total_weight . '<br>';
            }
    
            // if not valid_zone_id
            if ($check_flag == true) {
              if ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
                // add in weight if NOT ALL Always Free shipping
                $total_weight += $_SESSION['cart']->free_shipping_weight;
    //echo 'USA ALL FREE add weight ' . $total_weight . '<br>';
              } else {
                // do not add in weight if ALL Always Free shipping
    //echo 'USA MIXED just non free shipping ' . $total_weight . '<br>';
              }
            }
    // bof: allow 1 zone only for Always Free Shipping
    
    
        if (is_array($this->modules)) {
    The USPS shipping module:
    /includes/modules/shipping/usps.php

    should have:
    Code:
        // disable only when entire cart is free shipping
    //    if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
    //    }
    The Free Shipping Options freeoptions:
    /includes/modules/shipping/freeoptions.php

    Make sure that you have that set for:
    Total >= 0.00

    and you should then have the US Zone set on it ...

    Then, you should have the code in RED:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
              $this->enabled = ((MODULE_SHIPPING_FREEOPTIONS_STATUS == 'True') ? true : false);
          }
    
    // bof: Always Free Shipping
          if (!IS_ADMIN_FLAG) {
            global $cart;
            if ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
              $this->enabled = true;
            } else {
              $this->enabled = false;
            }
          }
    // eof: Always Free Shipping
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREEOPTIONS_ZONE > 0) ) {
    Does this do what you are trying to do here?

    I would really consider how you are managing the US Free Shipping Only vs the US Mixed Cart ... make sure you really want to charge for the USPS in this manner ...

    Put in your heaviest Always Free Shipping Product and look at the shipping ...

    Now add in your lightest NOT Always Free Shipping Product ... and look at the shipping ... are you sure you want it to work like that?
    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: v1.5.5]
    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!

  4. #54
    Join Date
    Jul 2009
    Location
    California
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping Module Programming Question

    Yes, this worked!! I know I had tried one of your solutions using freeoptions instead of freeshipper before, but maybe you added a few more lines of code! Also, not sure if I changed the zone code before. Either way, thanks a bunch!!

    Now add in your lightest NOT Always Free Shipping Product ... and look at the shipping ... are you sure you want it to work like that?
    Yes, this is exactly how I want it to look. I'm not sure I'm even seeing the problem you're alluding to here?

    And maybe I'm the only one, but we get these strange customers now and again who pay out-the-wazoo just to ensure they received priority mail instead of first class shipping. I'm sure that'll be the case with the free shipping items on rare occasions too - thus allowing for ALL the options.

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

    Default Re: Shipping Module Programming Question

    I added some extra code to make it do the bizzaro thing you wanted ...

    What I am saying is, if I have a 7lb Always Free Shipping in the cart, I get:
    Free shipping
    USPS for 7lbs

    If I then add a 0.10 lb NOT Always Free Shipping to the cart, I now get:
    USPS for 0.10lbs

    So this gives me a way to select USPS for dirt cheap faster USPS for 0.10lbs by just adding a cheap low weight 0.10lb product to the order to get a fast method of shipping for the whole 7.10lb order where before I had to pay for the faster USPS 7lbs -- or -- get the Free Shipping ...
    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: v1.5.5]
    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!

  6. #56
    Join Date
    Jul 2009
    Location
    California
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping Module Programming Question

    Ah, I see what you mean. I guess I should have clarified that I ONLY ship First Class or Priority Mail (and those are the only options I have set to show in the cart). So if they select a heavy free shipping item, then I've already taken the shipping cost into account and adding any small not-free shipping item still won't allow them to select Express or other faster/more expensive shipping methods.

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

    Default Re: Shipping Module Programming Question

    So I have 12lbs of Always Free Shipping in the cart and by shipping choices are:
    Free Shipping
    United States Postal Service (1 x 12.00lbs) (Priority Mail (2 - 3 days)) $13.00
    I add a 0.10 non-free shipping to the cart, in addition to the 12lbs Always Free Shipping so now I have:
    United States Postal Service (1 x 0.10lbs) (Priority Mail (2 - 3 days)) $5.10
    Is that really what you want to happen?
    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: v1.5.5]
    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. #58
    Join Date
    Jul 2009
    Location
    California
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping Module Programming Question

    Yep. If I say the 12lbs of product is free shipping, then I've already priced them accordingly. Then if they add a like 0.10 non-free shipping item, it actually shows them options of First Class Shipping for $2.40 or Priority Mail for $5.79. So yes, they can order 12.1 lbs of product for a total shipping of only $2.40.

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

    Default Re: Shipping Module Programming Question

    So the idea is you do not lose either way ... and the customer can make out if they figure out how your shipping works ... and just add that cheap, low weight product to the cart ... correct?
    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: v1.5.5]
    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. #60
    Join Date
    Jul 2009
    Location
    California
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping Module Programming Question

    It's really not that complicated... ;) The customer will be able to know if they're buying a free shipping item before adding it to their cart. And if they add that cheap, low-shipping item to their cart, it really does nothing more for the customer unless they WANT the item. It's basically just buying the items they want - some they don't have to pay the shipping costs for - some they do. The cart now shows that pretty clearly I think, and if not, I do plan on adding a little note as to why the Free Shipping option doesn't show for a mixed cart.

 

 
Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. upgrade question about Payment and shipping module: notice
    By icikite in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 20 Jan 2013, 11:08 PM
  2. Replies: 14
    Last Post: 11 Jun 2012, 05:39 AM
  3. Replies: 2
    Last Post: 8 Jul 2010, 09:46 PM
  4. Free shipping item weight calculated wrongly for non valid free shipping zone
    By firehorse in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 28 Oct 2006, 05:39 PM
  5. Question about COD Fee and DHL Shipping module
    By rkeppert in forum Addon Shipping Modules
    Replies: 7
    Last Post: 2 Sep 2006, 01:36 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR