Forums / Addon Shipping Modules / Hide USPS International Large Envelope option if products don't fit

Hide USPS International Large Envelope option if products don't fit

Views: 2,686

Results 1 to 20 of 20
9 Dec 2013, 1:51 AM
#1
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Hide USPS International Large Envelope option if products don't fit

Is it possible to limit subcategories of USPS First Class based on product category?

I have two categories of products that fit in a Large Envelope, and one category that must go in a First Class Package. My customers, obviously, choose the cheapest option, even though the 3x3x2 box from the third category will not fit in a Large Envelope (They don't know that). Changing the weight skews the rates for other calculations and discourages quantity orders. Shipping all three categories in a box adds unnecessary cost.

The main problem for me is that having the Large Envelope option incorrectly available reduces the international shipping I collect by as much as half, leaving me to pay the difference.

I've also added a tare weight of 3oz to cover a box, but that affects the Large Envelope rate as well.

Seems possible to disallow Large Envelope if a product from the category that doesn't fit in an envelope is added to the cart. Am I on the right track? I've read that passing dimensions to the USPS calculator through attributes would disqualify a product thicker that a half inch from displaying the Large Envelope option.

Thanks for your help

Herb
EverythingTiny.com
ZC 151
Numinix Google Merchant
Numinix Fast Easy Checkout
Cross Sell Plus

9 Dec 2013, 2:23 AM
#2
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

We ship items that I would say are in that dimensional size, both domestic and International in size 2 or size 3 bubble mailer envelopes without a problem.

Large envelope (1/4" - 3/4" thick) rates are the same as Thick envelope ( > 3/4") rates. The minimum rate is for 3 ounces, $1.69 domestic. We add 0.1 pound to account for the weight of the padded envelope, packing slip, label and a tiny bit to spare.

Is there something that I'm not seeing with this picture?

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

9 Dec 2013, 2:58 AM
#3
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

Thanks for your prompt answer RixStix.

The real problem (rather than speaking abstractly) is that I have a matchbook sized product. Several fit in a First Class Large Envelope and cost $6.55 to most of the world. I have an add-on product for that item which is 3"x3"x2" and glass. It cannot go in an envelope. However, my clients complain if they are charged the First Class Package rate (about $13) if they only order the matchbook sized product without the add-on that only fits in a box.

The USPS international rate for Large Envelope is half that of a box. A box that is 4 ounces is $3 cheaper than a box that is 4.1 ounces. A box to Australia with an item from the category that doesn't fit in a Large Envelope costs me around $13 plus box/packing/tape/etc. while the customer pays $6.55 for Large Envelope because that option is available.

Seems like it would be pretty easy to code something that negates the Large Envelope option when a customer puts the item in their cart, rather than adding tare weight and incorrect additional product weight, or adding expense to the customer by shipping a $9 quarter ounce item in a $13 box. I was reading a thread about golf shoes where there was an exception for that product getting First Class shipping. My custom code, if I knew how and where, would split that distinction into First Class Large Envelope and First Class Package.

9 Dec 2013, 3:17 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

If you can control this based on the master_catgegories_id for the Products then you could customize the USPS shipping module in:
/includes/modules/shipping/usps.php

and add the code in RED:

[B]// *** Customizations once per display ***
// bof: skip for cat 10 or 15 if First-Class Mail Large Envelope or First-Class MailRM International Large Envelope**
      $chk_cats = 0;
      $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','10');
      $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','15');
// eof: skip for cat 10 or 15 if First-Class Mail Large Envelope or First-Class MailRM International Large Envelope**

[/B]      for ($i=0; $i<$PackageSize; $i++) {
[B]// bof: skip for cat 10 or 15 if First-Class Mail Large Envelope or First-Class MailRM International Large Envelope**
//echo 'USPS $type_rebuilt: ' . $type_rebuilt . ' $chk_cats: ' . $chk_cats . (preg_match('#Large Envelope#i',$type_rebuilt) ? ' MATCH' : ' NO MATCH') . '<br>';
            if (preg_match('#Large Envelope#i',$type_rebuilt) && $chk_cats > 0) {
              continue;
            }
// eof: skip for cat 10 or 15 if First-Class Mail Large Envelope or First-Class MailRM International Large Envelope**
[/B]
          $methods[] = array('id' => $type_rebuilt,
                             'title' => $title,
                             'cost' => $cost,
                            );

where the Categories that have the Products to test for are 10 and 15 ... just change those values to match your categories ...

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!

9 Dec 2013, 3:52 PM
#5
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

That's pretty amazing! (...and not very simple for a non-PHP person). Thank you!

It works great for international, but the whole First Class price tier is removed when an item from Category 10 or 15 (Category 3 in my cart) is added domestically, so the First Class Parcel is not available. I could get away with making it Priority Mail, but if it's an easy fix, I'll buy you 2 coffees. :)

9 Dec 2013, 4:07 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

What weight are you using on that test?

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!

9 Dec 2013, 6:07 PM
#7
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

I tried several weights/products: 0.01 (one envelope item), 0.04 (four envelope items), one box item (0.125) and a mixed cart.

I have a $1 domestic and $4 international handling fee in the USPS module because the large envelope rate is coming up short.

I also have a tare weight of 0.1875 in Configuration > Shipping/Packing to account for a box.

I'm set to Retail rates as per another thread.

9 Dec 2013, 7:06 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

What is the total weight of the Order when you are testing this and not seeing First Class?

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!

9 Dec 2013, 8:43 PM
#9
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

Ajeh:

What is the total weight of the Order when you are testing this and not seeing First Class?

Every weight from 1oz (0.125) up when an item from category 3 is in the cart. I offer priority mail, so that's the next option, then FedEX, & UPS.

9 Dec 2013, 10:40 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

Can you go to Modules ... Shipping ... and click on USPS and edit it and at the bottom set the Debug to Logs ...

Then try a quote in Checkout for your shipping ...

Next, look in your FTP at the /logs and Zip the last 3 newest files that start with:
SHIP_usps_Debug_something.log

and attach it to your post ...

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 Dec 2013, 2:20 AM
#11
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

Attachment #13489

I put an item from category 1 in the cart and checked rates to Delaware & Australia. Then I added an item to the cart from category 3 (category 10 or 15 in your code) and calculated the rates again for the same destinations.

10 Dec 2013, 2:04 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

On your Tare Rate it looks like for Small/Medium you have set it as:
0.1875

change that to:
0:0.1875

Next, create an order that you are testing and post the URL to your site and the products_id that you are using so we can try to recreate the order on your site or, just post the login information to your test account so we can actually see this Order and try a few things ...

On your USPS shipping module, what are the categories_id that you have set that need to skip:
First-Class Mail Large Envelope or First-Class MailRM International Large Envelope**

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 Dec 2013, 3:43 PM
#13
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

Attachment 13491Attachment 13492
Path1/Category1 product that fits in an envelope:
http://everythingtiny.com/index.php?main_page=product_info&cPath=1&products_id=1
Path3/Category3 product that requires a box:
http://everythingtiny.com/index.php?main_page=product_info&cPath=3&products_id=12

With Tare set to 0:0.1875 the International Large Envelope rate comes up around $4.60, but should be $6.55, and the International First Class Package is coming up $8.45. It should be around $12, so I added $3 to the general international handling fee. Would be nice if it was accurate, instead of $3 off. Gotta love the USPS.

Your code works to negate the International Large Envelope shipping option when a product from path3/category3 is added to the cart. I'm o.k. with the domestic First Class Parcel not showing up with an item from path3/cat3 in the cart if it's a headache to trace. Priority mail isn't too expensive to kill sales. The rest seems to be USPS error.

Thanks for your help with this!

10 Dec 2013, 4:16 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

So far, I cannot reproduce the First Class being removed altogether on my site ...

Could you Zip and attache your file for:
/includes/modules/shipping/usps.php so I can try it directly on my site?

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 Dec 2013, 6:15 PM
#15
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

10 Dec 2013, 7:00 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

Okay ... let's review ...

If I have products from category 3 in my cart I do not see either:
First-Class Mail Large Envelope or First-Class MailRM International Large Envelope**

But when I ship to Australia, I get $12.75 for shipping and on your site I get $15.75 for shipping, which is your additional handling of $3.00 ...

I do see on your site that when shipping to the US I do not get a First Class shipping rate with USPS but I do on my site ...

If you look at your debug logs can you refresh that /logs in your FTP and Zip up again that last half dozen log files and post it?

Also, can you turn on the setting in Configuration ... Shipping/Packaging ... for displaying Boxes and Weight by setting this to 3:

Display Shipping Weight and Number of Boxes?

0= off
1= Boxes Only
2= Weight Only
3= Both Boxes and Weight

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 Dec 2013, 7:34 PM
#17
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

Attachment #13494
Done.

Since installing Fast Easy Checkout by Numinix, I've had "Checkout" in all the title bars. I've re-followed the installation steps twice to see if I put something in the wrong place, but to no avail. I don't know how that could be the culprit, but I've gotten the white screen many times for an errant semicolon in the PHP code in an edit that seemed inconsequential.

Sounds like a fresh install might be what I need in January if it works correctly on your site.

10 Dec 2013, 7:53 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

I really am not sure how to advise you at the moment, as you code also works fine on my site ...

You could try checking that the file:
/includes/modules/shipping/usps.php

that is on the server matches the code on your computer ...

Then, you could try to do a REMOVE, INSTALL and re-configure of it on your site ...

But I am not finding anything that stands out as to why you are having this issue ... :lookaroun

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 Dec 2013, 10:33 PM
#19
herbert_hoover avatar

herbert_hoover

New Zenner

Join Date:
Feb 2013
Location:
New York, New York, United States
Posts:
25
Plugin Contributions:
0

Re: Hide USPS International Large Envelope option if products don't fit

Did a clean download of USPS.php from the July 28th update and the July 30th update. Seems the July 30th update (includes > modules > shipping > usps.php) was corrupted.

Everything seems to be working now.

I owe you a few coffees.

10 Dec 2013, 11:11 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Hide USPS International Large Envelope option if products don't fit

Thanks for the update that everything is working now ...

Coffee and donuts are always appreciated! :cool:

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!