Post by hcamelion » Fri Jun 05, 2015 2:35 pm

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.

Henry Weismann
877.44.MY.WEB (877.446.9932)
We can help with your Opencart Site - Opencart Web Developer

Image


User avatar
New member

Posts

Joined
Mon Jul 27, 2009 3:14 am
Location - Albany, NY, USA

Post by JeffroDH » Fri Jun 05, 2015 2:40 pm

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. :-\

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by JeffroDH » Fri Jun 05, 2015 2:43 pm

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.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by JeffroDH » Fri Jun 05, 2015 3:03 pm

@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.
Last edited by JeffroDH on Fri Jun 05, 2015 3:25 pm, edited 1 time in total.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by hcamelion » Fri Jun 05, 2015 3:12 pm

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!

Henry Weismann
877.44.MY.WEB (877.446.9932)
We can help with your Opencart Site - Opencart Web Developer

Image


User avatar
New member

Posts

Joined
Mon Jul 27, 2009 3:14 am
Location - Albany, NY, USA

Post by alexwrekk » Sat Jun 13, 2015 3:06 am

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!

Newbie

Posts

Joined
Sat Jun 13, 2015 3:02 am

Post by kimbo » Wed Jun 17, 2015 12:40 am

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,

kimbo
The Chloelina All Natural Soap Co.
chloelina.com


Active Member

Posts

Joined
Thu Aug 29, 2013 10:02 pm

Post by JeffroDH » Wed Jun 17, 2015 1:14 am

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.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by kimbo » Wed Jun 17, 2015 2:06 am

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

kimbo
The Chloelina All Natural Soap Co.
chloelina.com


Active Member

Posts

Joined
Thu Aug 29, 2013 10:02 pm

Post by ross_badger » Wed Jun 17, 2015 9:15 am

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

Newbie

Posts

Joined
Wed Dec 10, 2014 9:26 am

Post by JeffroDH » Wed Jun 17, 2015 9:22 am

You have to change the API request. I believe it's the <Service>All</Service>. Change the tag from ALL to ONLINE.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by JeffroDH » Wed Jun 17, 2015 9:23 am

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?

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by ross_badger » Wed Jun 17, 2015 9:26 am

Yes, I live in the US and when trying to ship to Canada, I get the rates shown below in the attachment.

Ross

Attachments

ScreenHunter_86 Jun. 16 21.25.jpg

ScreenHunter_86 Jun. 16 21.25.jpg (23.38 KiB) Viewed 5114 times


Newbie

Posts

Joined
Wed Dec 10, 2014 9:26 am

Post by JeffroDH » Wed Jun 17, 2015 9:43 am

Bollocks. I'll have a look ASAP.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by sistawig » Thu Jun 18, 2015 1:13 am

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.

New member

Posts

Joined
Tue Nov 25, 2014 1:37 am

Post by sistawig » Thu Jun 18, 2015 1:15 am

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/

New member

Posts

Joined
Tue Nov 25, 2014 1:37 am

Post by sistawig » Thu Jun 18, 2015 1:59 am

I just had to disable(rename) the vqmod xml and enable again and it worked somehow.

New member

Posts

Joined
Tue Nov 25, 2014 1:37 am

Post by JeffroDH » Thu Jun 18, 2015 2:01 am

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.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by JeffroDH » Thu Jun 18, 2015 2:13 am

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.

Active Member

Posts

Joined
Thu Jul 11, 2013 8:29 am

Post by sistawig » Thu Jun 18, 2015 2:23 am

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

New member

Posts

Joined
Tue Nov 25, 2014 1:37 am
Who is online

Users browsing this forum: No registered users and 21 guests