Page 10 of 38 FirstFirst ... 8910111220 ... LastLast
Results 91 to 100 of 379
  1. #91
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    282
    Plugin Contributions
    3

    Default Re: USPS Shipping Module [Support Thread]

    Twitchtoo Have you made any progress with this?

    Unfortunately I have not... I contacted USPS to see if it could be something going on with my account on their end of things, but after several phone calls and emails I am not getting any response from them.

  2. #92
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    I've installed the new USPS shipping module and I'm getting the error "Nothing has been selected for quotes." I'm dead in the water on a busy weekend until this is fixed. I've looked at all the things you can edit for the module and don't see anything that hasn't been set the same way as it was before, as directed in the installation instructions. What am I doing wrong?

    I did track down where the error message is coming from--"Will auto-disable the shipping method if either no services // have been selected or the country-of-origin is not the US." Neither of those conditions is true.
    Last edited by HeleneWallis; 30 May 2021 at 01:53 PM.

  3. #93
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by HeleneWallis View Post
    I've installed the new USPS shipping module and I'm getting the error "Nothing has been selected for quotes." I'm dead in the water on a busy weekend until this is fixed. I've looked at all the things you can edit for the module and don't see anything that hasn't been set the same way as it was before, as directed in the installation instructions. What am I doing wrong?
    A screenshot of your USPS settings would help. What version of Zen Cart is in use?

  4. #94
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Never mind, I realized that none of the boxes for the shipping rates were checked. Problem fixed.

  5. #95
    Join Date
    Mar 2021
    Location
    Campbell, Texas USA
    Posts
    13
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by tedjmaines View Post
    I have never got it working. in previous edition v154 and beyond, we did flat rate. I would like to get this working. I read the other versions post but it does not work for v157c with K11. If someone got it to work in previous versions of USPS maybe they can let you know. The code I read before used a master category number for Media (mine is Master_id = 5) for loop but that did not work on my K11.
    Still have this issue with new K11a on v157c. I put the proper category for books which is shipped Media Parcel Mail in code as instructed. What it is suppose to do is if anything is NOT a book is put in cart then Media Mail option should not be shown, but on my site Media Mail option is always shown. Anyone have a thought on why??? Thanks.

  6. #96
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by tedjmaines View Post
    Still have this issue with new K11a on v157c. I put the proper category for books which is shipped Media Parcel Mail in code as instructed. What it is suppose to do is if anything is NOT a book is put in cart then Media Mail option should not be shown, but on my site Media Mail option is always shown. Anyone have a thought on why??? Thanks.
    I had a similar situation. Ajeh (Linda) provided me with a starter routine to permit the exclusion of a class or classes of shipping types depending on the shopping cart contents. To my amazement, that starter code is now in the new version of usps.php, and available for anyone to play with.

    With whatever editor program you're using, do a search for " // *** Customizations once per display ***"

    The lines after that are as follows:

    // bof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart
    // change false to true to use
    if (false) {
    $chk_cart = 0;
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','12');
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','15');
    }
    // see below use of $chk_cart
    // eof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart

    This was my initial attempt to keep certain things from being shipped in a small flat rate box, and $master_categories_id shown here was the first two categories that I needed to exclude from small flat rate shipping . I have since expanded on this to exclude a wide variety of shipping types, depending on the category or the product or the quantity being ordered. If you want to try this, simply substitute your category number for books for the '12' shown in the example above. You'll need to comment out the next statement if you don't want your category '15' to be similarly affected. And it would be a good idea to substitute the shipping type you're excluding (Media) in the comments, in place of the 'USPS Priority MailTM Small Flat Rate box' verbage. Otherwise, someone (possibly you) is going to be really confused at some point in the future when you need to edit this section or figure out why something isn't working.

    There is one more place where you need to insert a few lines. Search for "$type_rebuilt = $type;"

    The first few lines after that should read:

    // bof: example to block USPS Priority MailTM Small Flat Rate Box when anything from specific master_categories_id are in the cart
    // see above for $chk_cart settings
    // change false to true to use WAS FALSE
    if (true) {
    if ($chk_cart > 0 && $type == 'Priority MailTM Small Flat Rate Box') {
    // echo 'USPS $type: ' . $type . ' $chk_cart:' . $chk_cart . ', line 575 <br>';
    continue;
    }
    }
    // eof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart

    You'll need to substitute 'MEDIA' where the line above says 'Priority MailTM Small Flat Rate Box.' And you might want to change the wording of the comments so it's refers to Media Mail rather than the Small Flat Rate Box in the code.

    The first section of code checks the category number of the items in the cart. If any of them is in a category that could not be shipped by the specified shipping type, then it increments the variable $chk_cart. The second section of code tests $chk_cart to see whether it is greater than zero AND if the shipping type variable ($type) is exactly equal to the value in the quotes. If so, that shipping type will be excluded from the list of shipping types that the customer can choose from.

    If you're comfortable tweaking the code, you can expand on this the same way I did, to check for multiple different product or category numbers, for the quantities of certain items, and for whatever else you need to exclude from certain shipping types. Over the years, I've added enough checks that it's very seldom a customer can specify a shipping type unsuitable for the product(s) in the cart. Every test you add will slow down execution just a little bit, of course, so it you have an extremely varied inventory, this may not work well for you. But it has been ideal for us, with a fairly small number of broad categories.

  7. #97
    Join Date
    Mar 2021
    Location
    Campbell, Texas USA
    Posts
    13
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by HeleneWallis View Post
    The first section of code checks the category number of the items in the cart. If any of them is in a category that could not be shipped by the specified shipping type, then it increments the variable $chk_cart. The second section of code tests $chk_cart to see whether it is greater than zero AND if the shipping type variable ($type) is exactly equal to the value in the quotes. If so, that shipping type will be excluded from the list of shipping types that the customer can choose from.
    Thank you Helene. I did modifications as you suggested and it works the reverse that I need. I need only master category 15 (books) to use Media Mail. What I have is category 15 (books) excludes the Media Mail and all other non-books show media mail. So my logic is backwards. I tried changing true and false but does not seem to work. Must have made a logic error.

  8. #98
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by tedjmaines View Post
    Thank you Helene. I did modifications as you suggested and it works the reverse that I need. I need only master category 15 (books) to use Media Mail. What I have is category 15 (books) excludes the Media Mail and all other non-books show media mail. So my logic is backwards. I tried changing true and false but does not seem to work. Must have made a logic error.
    I see that I phrased something backwards. What you need to do is not substitute your category number for books, but to add all the category numbers except the one for books. Changing true to false will just prevent the code from being executed at all.

    For example, this shows two categories excluded from Small Flat Rate box shipping. That was my original requirement. Now I have four categories excluded, plus a couple of product numbers that are in permitted categories but are still not appropriate to ship in a Small Flat Rate box. I also have exclusions in otherwise permissible categories based on the quantity of items ordered (two would be okay in a Small Flat Rate box, three would not be okay, for example).

    If you have a very large number of categories, so many that adding a conditional statement for every one of them except books wouldn't be feasible, you might want to look at reorganizing your categories so you have broader ones that include more kinds of products. For example, I had one category that included all the products from a particular vendor. Then he started producing a product that fell more logically into another category I already had set up. Except that it required me to add many more conditional statements to keep that new product from being shipped in certain size boxes, even though everything else in that category could be shipped in those boxes. I eventually moved the new product to the category that included all the others from that vendor, and was able to simplify the shipping code considerably.
    Last edited by HeleneWallis; 31 May 2021 at 01:17 PM.

  9. #99
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: USPS Shipping Module [Support Thread]

    If you're using USPS K11a, then including a modified version of the autoloaded observer example (present in the zip-files /extras sub-directory) should disable media-mail unless all products in the cart are from category 15:
    Code:
                case 'NOTIFY_USPS_UPDATE_OR_DISALLOW_TYPE':
                    // -----
                    // Disallow "Media Mail" unless all products in the cart have their master_categories_id within category 15.
                    //
                    if (stripos($p1, 'Media Mail') !== false) {
                        $chk_media = 0;
    
                        $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id', '15');
                        if ($chk_media == $_SESSION['cart']->count_contents()) {
                            $p2 = false;
                        }
                    }
                    break;
    If that books category contains sub-categories, you'll need to add additional lines to check for the presence of each of the sub-categories.

  10. #100
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by lat9 View Post
    If you're using USPS K11a, then including a modified version of the autoloaded observer example (present in the zip-files /extras sub-directory) should disable media-mail unless all products in the cart are from category 15:
    Code:
                case 'NOTIFY_USPS_UPDATE_OR_DISALLOW_TYPE':
                    // -----
                    // Disallow "Media Mail" unless all products in the cart have their master_categories_id within category 15.
                    //
                    if (stripos($p1, 'Media Mail') !== false) {
                        $chk_media = 0;
    
                        $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id', '15');
                        if ($chk_media == $_SESSION['cart']->count_contents()) {
                            $p2 = false;
                        }
                    }
                    break;
    If that books category contains sub-categories, you'll need to add additional lines to check for the presence of each of the sub-categories.
    Thanks, I can use that too.

 

 
Page 10 of 38 FirstFirst ... 8910111220 ... LastLast

Similar Threads

  1. MultiSite Module Support Thread
    By Gerome in forum All Other Contributions/Addons
    Replies: 2220
    Last Post: 13 Mar 2024, 01:24 PM
  2. Optional Shipping Insurance Module [Support Thread]
    By jettrue in forum Addon Shipping Modules
    Replies: 396
    Last Post: 31 Mar 2023, 05:35 PM
  3. Replies: 29
    Last Post: 24 Sep 2014, 09:59 PM
  4. Replies: 335
    Last Post: 1 Aug 2013, 08:54 PM
  5. PC Configurator Module [Support Thread]
    By lebrand2006 in forum All Other Contributions/Addons
    Replies: 254
    Last Post: 22 Aug 2012, 03:52 PM

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