Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Any Way To Force USPS Express Shipping based on dollar amount?

    Is there anyway to force USPS Express shipping if the order amount is over a certain amount?

    ex. $8 order

    the regular shipping options:
    1st Class Mail International (no tracking)
    Express Mail International (tracking)


    $1000 order

    shipping options:
    Express Mail International (tracking) only


    using USPS Shipping API quotes (weight)
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

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

    Default Re: Any Way To Force USPS Express Shipping based on dollar amount?

    You can use something like this in the quote function:
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
    
    // bof: skip shipping method type based on amount
              $skip_method = false;
              $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices();
    // echo 'Type: ' . $type . '<br>';          
              if ($order_total_amount > 8 && $type == 'First-Class Mail International Letter') {
                $skip_method = true;
              }
              if ($skip_method) { 
                // do not show
              } else {
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
              }
    // eof: skip shipping method type based on amount
            }
    
            $this->quotes['methods'] = $methods;
    You can uncomment the echo line to see for sure what your type is on the shipping that you want to make disappear ... it has to be exactly the same ...

    The code in red is the new code ...
    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!

  3. #3
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Any Way To Force USPS Express Shipping based on dollar amount?

    Works Perfectly!

    How would I add one more mail class to this skip method?

    PHP Code:
          if ($order_total_amount && $type == 'First-Class Mail International Letter') {

    to something like

          
    if ($order_total_amount && $type == 'First-Class Mail International Letter''Priority Mail') { 
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

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

    Default Re: Any Way To Force USPS Express Shipping based on dollar amount?

    Close but ... not quite ...

    Try:
    Code:
          if ($order_total_amount > 8 && ($type == 'First-Class Mail International Letter' || $type == 'Priority Mail')) {
    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!

  5. #5
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Any Way To Force USPS Express Shipping based on dollar amount?

    Wooo Hooo!

    Good Old pipe-y "||" pants!

    Thanks Again!
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

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

    Default Re: Any Way To Force USPS Express Shipping based on dollar amount?

    You are most welcome ... thanks for the update that you have this working now with the exclusions of USPS methods based on the type and amount of the order ...
    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!

 

 

Similar Threads

  1. v153 shipping based solely on dollar amount???
    By jpmill in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 23 Oct 2014, 07:01 AM
  2. v139f Is there a way to limit the cart dollar amount? Having scammer problems!
    By osdparts in forum Managing Customers and Orders
    Replies: 2
    Last Post: 2 Apr 2013, 05:31 AM
  3. Is there a way to put a limit on dollar amount I can accept PayPal for?
    By OnlySeaDoo in forum PayPal Express Checkout support
    Replies: 9
    Last Post: 9 Mar 2012, 05:46 PM
  4. Force Express Mail International on high dollar amount orders
    By dharma in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Jan 2010, 04:13 PM
  5. flat-rate shipping based on the dollar amount
    By chris32882 in forum Built-in Shipping and Payment Modules
    Replies: 13
    Last Post: 2 Nov 2008, 05:59 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