Page 3 of 3

Re: USPS Flat Rate Boxes with Dimensions

Posted: Fri Jan 27, 2012 8:35 am
by Rainforest
Well!!

It looks like the 1.4 mod from above WORKS!! I tested it with a few different quantities.

The only problem is that it shows an error message (does stop you from checking out)

"Notice: Undefined index: code in /home/xxx/public_html/catalog/view/theme/default/template/checkout/shipping.tpl on line 14"

Any ideas anyone? Q?

Re: USPS Flat Rate Boxes with Dimensions

Posted: Mon Mar 05, 2012 1:38 pm
by Qphoria
You need to change all reference of
['id']
to
['code']
in 12 oclockers module

Re: USPS Flat Rate Boxes with Dimensions

Posted: Wed Mar 07, 2012 9:50 am
by Windlasher
Qphoria wrote:You need to change all reference of
['id']
to
['code']
in 12 oclockers module

sorry, not a programmer. can you elaborate.... change what? where?

yes I can edit the php files. :-)

thanks in advance.

Re: USPS Flat Rate Boxes with Dimensions

Posted: Wed Apr 11, 2012 10:36 pm
by vivekdbit
It is not the perfect solution.
take an exmple,
If my cart having 5 products having (3*3*11) so total space covred is 495 cubic.
495 is less than 514.25 so this 5 product logically fits inside the Medium Flat Rate Box.
But practically it is not possible.

Re: USPS Flat Rate Boxes with Dimensions

Posted: Thu Apr 12, 2012 5:30 am
by ebuison
Anyone have an idea why the shipping option is showing "<sup>&reg;</sup>" after Priority Mail?

Priority Mail<sup>&reg;</sup> Medium Flat Rate Box (Trackable)

The boxes are calculating correctly, but it's just showing the html tag.

Using 1.5.1.3

Thanks!

Re: USPS Flat Rate Boxes with Dimensions

Posted: Thu Apr 12, 2012 6:05 am
by ebuison
...never mind...after a lot of searching and trying to fix the code myself.

http://forum.opencart.com/viewtopic.php?t=25128#p123964

Re: USPS Flat Rate Boxes with Dimensions

Posted: Thu Apr 12, 2012 12:24 pm
by Qphoria
ebuison wrote:Anyone have an idea why the shipping option is showing "<sup>&reg;</sup>" after Priority Mail?

Priority Mail<sup>&reg;</sup> Medium Flat Rate Box (Trackable)

The boxes are calculating correctly, but it's just showing the html tag.

Using 1.5.1.3

Thanks!
I assume USPS just changed their labels again to add the &reg back in a diff way than the code adjusts for.

Re: USPS Flat Rate Boxes with Dimensions

Posted: Mon Apr 16, 2012 6:32 pm
by vivekdbit
what if i am having 1 small box and 2 Large box,

I want the output as,

1 * Priority Mail Small Flat Rate Box + 2 * Priority Mail Large Flat Rate Box

Cost = 1* $5.35 + 2* $15.45
Total Shipping Cost = $36.25

Re: USPS Flat Rate Boxes with Dimensions

Posted: Wed Jun 26, 2013 9:47 am
by dues
Hi Does anyone have an updated version of this code for 1.551

Thank You

Re: USPS Flat Rate Boxes with Dimensions

Posted: Fri Jun 28, 2013 8:34 am
by spoon
I just tested my updated vQmod on a 1.5.5.1 and it seems to be working as expected.
Let me know.

Re: USPS Flat Rate Boxes with Dimensions

Posted: Tue Nov 19, 2013 9:40 am
by DSTAngieB
Does anyone know if the original fix works in ver. 1.5.6??? This is exactly the problem that I need to have solved on my website and before try it, I wondered if anyone else has had any success with this lately?

Re: USPS Flat Rate Boxes with Dimensions

Posted: Tue Nov 19, 2013 11:36 am
by Cue4cheap
DSTAngieB wrote:Does anyone know if the original fix works in ver. 1.5.6??? This is exactly the problem that I need to have solved on my website and before try it, I wondered if anyone else has had any success with this lately?
DSTAngieB,

Just tested it for you with 1.5.6.

It seems to work just fine. Now a caveat. I have not check this out 100% and I JUST installed it but here are a few things.....
- You MUST populate the products with dimensions in order for this to work.
- This may NOT work right for 'odd' sizes. I entered in a 36 x 2 x 2 dimension for a product. Now if you look at this page:
https://www.usps.com/ship/priority-mail-flat.htm you'll there is NO flat rate box that allows something to be sent with a length of 36 inches. But it showed the "Medium Flat Rate Box (Trackable)".

In my simple minded opinion this might work great for you BUT it also should do a check for any dimension that is > 25 inches and block all the flat rate boxes for a cart that contains those items...

My $0.02.

Mike

Re: USPS Flat Rate Boxes with Dimensions

Posted: Tue Nov 19, 2013 11:57 am
by Cue4cheap
Okay I couldn't leave this as I left it.

Go into the file and find the section that starts with: //figure out what the best flat rate box option is (This is done in Inches) down to the ending } OF THAT section....

and replace everything with this:

Code: Select all

                //figure out what the best flat rate box option is (This is done in Inches)
                $flbox = 0;//figure out what the best flat rate box option is
                if ( ($cubic < 75.33) && ($product['length'] < 8.5 ) ) {
                    $flbox = 1;     //Small Flat Rate Disable Check
                } else if ( ($cubic < 514.25) && ($product['length'] < 11 ) ){
                    $flbox = 2;     //Med Flat Rate Disable Check
                } else if ( ($cubic < 792)  && ($product['length'] < 24 ) ) {
                    $flbox = 3;     //Large Flat Rate Disable Check
                }
Now what this does is will turn off all of them IF you have the length set to 24 inches or more. It does not check specifically if you have the width or height set to anything because in my case I would set the length to the longest part of the item.

I hope it helps.

Mike
Edited: 2 Dec 13 to change the length for small and medium boxes

Re: USPS Flat Rate Boxes with Dimensions

Posted: Tue Nov 19, 2013 12:28 pm
by Cue4cheap
One more thought: The international flat rate boxes does not seem to be affected by the dimensional thing I added above. It is late so I might take a look at this later (or if someone else jumps in that would be great too).

Mike

Re: USPS Flat Rate Boxes with Dimensions

Posted: Tue Nov 19, 2013 8:58 pm
by Cue4cheap
Noticed last night before my head hit the pillow that this kicks some errors into the errorlog. I don't think it is contrib related but related to the reply from USPS. Thankfully the debug gives you loads of info so it might be a quick fix. If I get the time I'll see about it.......

Re: USPS Flat Rate Boxes with Dimensions

Posted: Wed Nov 20, 2013 11:06 am
by Cue4cheap
This is a bit more complicated then at first glance. The errors it kicks is only for international because the variable it responds with is different the domestic quotes.
So logically I would have to look in the current USPS modules and see where / how it looks at the returned info and see if it already tracks the two variables returned from USPS and also if it acts upon the two differently. At this time I am not at a location I can look into the files.
Mike

Re: USPS Flat Rate Boxes with Dimensions

Posted: Wed Nov 20, 2013 1:16 pm
by Cue4cheap
Okay found out the problem. It was generating errors for Undefined variable: classid. This is because in the international section of the mod it isn't using classid but just id. SOOOOO.................

Find the section of code that starts with:
<!-- Add trackable status to title for International shipments -->
Specifically find this line:

Code: Select all

                if (($flbox != 1 && $id == 16) || ($flbox != 2 && $classid == 9) || ($flbox != 3 && $classid == 11)) {
And replace it with

Code: Select all

                if (($flbox != 1 && $id == 16) || ($flbox != 2 && $id == 9) || ($flbox != 3 && $id == 11)) {
This should work as intended and not kick any errors. Sorry it took so long but I was thinking it might be because of the change USPS made recently in how they returned the XML info that might have affected this but it turns out that isn't the case.
Hope it helps.
Mike

Re: USPS Flat Rate Boxes with Dimensions

Posted: Wed Mar 04, 2015 8:46 am
by jbuttons1
I have a question for this mod. I have installed it and it is working perfectly for domestic but not international I am only getting -Priority Mail International (Trackable)- as an option and not any flat rate options, even though the flat rate option are set. Any assistance will be greatly appreciated. Thank you.