Page 9 of 15

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Fri Jun 05, 2015 2:35 pm
by hcamelion
Im not sure about the error checking...I just know my client was not happy with the $0 (Which showed up as $3 for her because she has a S&H charge) so I told my dev to put in error checking so if it happens again atleast it wont show that method as an option. I think my philosophy is to always check for errors and to not assume things will always go smoothly. I may be a bit anal though with that philosophy. Basically we handle every single possible return value in our work especially errors.

If not handling the error another thing you could do which is essentially the same thing is only proceed with a valid value. In this case $0 shipping is not valid.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Fri Jun 05, 2015 2:40 pm
by JeffroDH
hcamelion wrote:RE: Also, is anyone else running into an error involving the <CommercialFlag> or <CommercialPlusFlag> tag? It's popping as an invalid tag on my installation. Odd, since it's in the documentation.

Maybe you are not setting the right revision/api version? That is just off the cuff.

Just had the XML elements out of order. SMH. :-\

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Fri Jun 05, 2015 2:43 pm
by JeffroDH
hcamelion wrote:Im not sure about the error checking...I just know my client was not happy with the $0 (Which showed up as $3 for her because she has a S&H charge) so I told my dev to put in error checking so if it happens again atleast it wont show that method as an option. I think my philosophy is to always check for errors and to not assume things will always go smoothly. I may be a bit anal though with that philosophy. Basically we handle every single possible return value in our work especially errors.

If not handling the error another thing you could do which is essentially the same thing is only proceed with a valid value. In this case $0 shipping is not valid.
Definitely try to follow that same philosophy, just pointing out to those reading that the error check code isn't necessary for the emergency fix. Some form of it will be put into the updated release that's forthcoming.

Looking at the problem a bit more, I think checking for both the value of $0 and the new <ServiceError> tag would be prudent. Perhaps an unrelated error could send the same result in the future.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Fri Jun 05, 2015 3:03 pm
by JeffroDH
@henkel @hcamelion:

Thank you for the detailed feedback (and code). Unfortunately I didn't see the responses until I had the primary problem solved, but I appreciate your willingness to help. And the beautiful formatting of the code.

In addition to the fixes posted here, I've added a conditional check in the XML query: The <AcceptanceDateTime> and <DestinationPostalCode> tags will only be added if a Destination Postal Code is submitted to OC. For actual shipments, I expect that every customer will enter their post code, but for the shipping quotes it's optional for many countries and the API will return an error if one is set without the other.

The update for 1.5.x is complete and has been tested. USPS API Update v1.5.0 will be available momentarily for download. I'll have a release of v1.5.0 available for OC 2.x shortly as well.

Apologies to all for the oversight.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Fri Jun 05, 2015 3:12 pm
by hcamelion
No problem. In coding mistakes/bugs happen all the time. Its not about them not happening its about the response time getting the right fix in. I think you have done well on both counts. Have a great night/day!

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Sat Jun 13, 2015 3:06 am
by alexwrekk
Hey there,
I just had a Canadian customer not be able to order so I read up about the postal code thing here. I downloaded and installed the new update and now I no longer get the cheaper postage prices as I did before and some people are only being shown a pick up at store option. This is not something I would be able to fix myself and I have a business I'm trying to run. Please help!

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 12:40 am
by kimbo
OC 1.5.5.1 customized OC default theme.
Vqmod 2.5.1

Hey, JeffroDH, rec'd the email notification and I downloaded your latest mod release to update the May 2015 USPS api.
It seems the new mod is causing my Estimate Shipping Quotes to hang.
Original version worked perfectly.
Dumb question, should I disable the first mod or do I run both?
Thanks,

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 1:14 am
by JeffroDH
I'm not sure what your Estimate Shipping Quotes mod does, or where the error is coming from. If it's a VQMod clash, then some clues should be in the vqmod error logs.

Only run one version of this mod at a time, and you might try disabling the either mod temporarily to see if your problem goes away. (change the extension to .xml.bak to easily disable it)

Post your vqmod error logs up here for more guidance.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 2:06 am
by kimbo
No, it is the View Cart screen to estimate the shipping charges before checking out.
I will re-install only the latest of your mod. If still not working, will post the vqmod error logs.
Thanks for the quick response!
Kim

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 9:15 am
by ross_badger
Hello - I've just installed OC Version 2.0.3.1 (latest) as well as this USPS API Update extension. It works great (with the exception of the "free" shipping from the US to Canada :-) ).

Can someone please take me through how I change the shipping rates to "Online" prices?

Thanks in advance!

Ross

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 9:22 am
by JeffroDH
You have to change the API request. I believe it's the <Service>All</Service>. Change the tag from ALL to ONLINE.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 9:23 am
by JeffroDH
ross_badger wrote:Hello - I've just installed OC Version 2.0.3.1 (latest) as well as this USPS API Update extension. It works great (with the exception of the "free" shipping from the US to Canada :-) ).

Can someone please take me through how I change the shipping rates to "Online" prices?

Thanks in advance!

Ross
Are you having issues with shipping to Canada?

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 9:26 am
by ross_badger
Yes, I live in the US and when trying to ship to Canada, I get the rates shown below in the attachment.

Ross

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Wed Jun 17, 2015 9:43 am
by JeffroDH
Bollocks. I'll have a look ASAP.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Thu Jun 18, 2015 1:13 am
by sistawig
I have the same problem again.

Last time when it happened, the fix by other users and your vqmod file fixed the issue. But It started appearing again.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Thu Jun 18, 2015 1:15 am
by sistawig
ross_badger wrote:Yes, I live in the US and when trying to ship to Canada, I get the rates shown below in the attachment.

Ross
I got the same exact issue again/

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Thu Jun 18, 2015 1:59 am
by sistawig
I just had to disable(rename) the vqmod xml and enable again and it worked somehow.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Thu Jun 18, 2015 2:01 am
by JeffroDH
sistawig wrote:I just had to disable(rename) the vqmod xml and enable again and it worked somehow.
Sounds like a caching issue, but I'm taking a look at the mod again to make sure I didn't miss anything else.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Thu Jun 18, 2015 2:13 am
by JeffroDH
ross_badger wrote:Hello - I've just installed OC Version 2.0.3.1 (latest) as well as this USPS API Update extension. It works great (with the exception of the "free" shipping from the US to Canada :-) ).

Can someone please take me through how I change the shipping rates to "Online" prices?

Thanks in advance!

Ross
Ross, if you've got the latest version of my VQMod, it is already pulling the online prices rather than the standard post office rates.

I'm not able to replicate your issue with the stock 2.x install. I'll need some VQMod error logs to see what's going on with your install.

Re: [VQMod] USPS API Update (Latest API Update)

Posted: Thu Jun 18, 2015 2:23 am
by sistawig
I think the reason for my error was this:

<code>$cost = 2 + $postage->getElementsByTagName('Rate')->item(0)->nodeValue;</code>

I was adding $2 above the shipping to charge automatic fees on shipping. When i removed the 2+ and reenabled the xml it worked