Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest conspicuouschick

usps rate increase = shipping module changes?

Recommended Posts

Would anyone like to see how they get on with this? It takes into account all the changes listed in the USPS email.

For me international shipping worked ok. If you have any issues let me know and I'll try to resolve them.

USPSv2a.zip

Share this post


Link to post
Share on other sites

Guest

Administration screens seem to work perfectly.

USPS options not showing up in checkout, however. I have First Class Letter and Flat Rate Priority enabled, and on a test purchase that should allow the Flat Rate, it's not showing up.

Cancel that, I see that I have to enter the box dimensions first, then it works. Now I have to measure the actual Flat Rate Box. Maybe this could be included in an update?

Thank you so much for doing this!

EDIT: For reference, a Flat Rate Box measures 14x12x3.5 inches (Should the numbers be inches, or something else?) and a Variable Rate Box measures 14x12x3.

Share this post


Link to post
Share on other sites
Guest midwest

Administration screens seem to work perfectly.

USPS options not showing up in checkout, however. I have First Class Letter and Flat Rate Priority enabled, and on a test purchase that should allow the Flat Rate, it's not showing up.

Cancel that, I see that I have to enter the box dimensions first, then it works. Now I have to measure the actual Flat Rate Box. Maybe this could be included in an update?

Thank you so much for doing this!

EDIT: For reference, a Flat Rate Box measures 14x12x3.5 inches (Should the numbers be inches, or something else?) and a Variable Rate Box measures 14x12x3.

Al- Thanks for the hard work ! Would love to try it out. Just Download the file in your post I assume ? Replace the current USPS file ?

AlanT- Dimensions should be in inches is what I assume as that is the measure that USPS uses. Don't think they use anything like 1'2" , etc in thier measurement calcs. Do not think they use metric measure either.

Not sure why you would have to include the measure for a Flat Rate box. They only have one as far as I know.

midwest :blink:

Share this post


Link to post
Share on other sites
Guest Mrs. B.

Thanks for the advice, Midwest. I was still trying to make sense of it all when this came through. But I do appreciate your time. Thank you!

Would anyone like to see how they get on with this? It takes into account all the changes listed in the USPS email.

For me international shipping worked ok. If you have any issues let me know and I'll try to resolve them.

The test went through, YEAH! Now when I enable it, it's not working from the front end. I'm guessing there is a delay between a successful test and when the USPS will make it live, after receiving the successful test? My client signed up more than a week ago and her username was copied & pasted and there is a password there... how long does it usually take? (Hopefully there is a "usual")

J.

Share this post


Link to post
Share on other sites
Guest midwest

Thanks for the advice, Midwest. I was still trying to make sense of it all when this came through. But I do appreciate your time. Thank you!

Would anyone like to see how they get on with this? It takes into account all the changes listed in the USPS email.

For me international shipping worked ok. If you have any issues let me know and I'll try to resolve them.

The test went through, YEAH! Now when I enable it, it's not working from the front end. I'm guessing there is a delay between a successful test and when the USPS will make it live, after receiving the successful test? My client signed up more than a week ago and her username was copied & pasted and there is a password there... how long does it usually take? (Hopefully there is a "usual")

J.

Yes there is a delay, and you should receive an email when it is live, or yo can call the Phone number listed in the module and they might turn it on for you. However, if you were live and enable before, unless you changed your ID info, not sure it has to "go live" again ?

Any body have an answer for this quandry?

midwest B)

Share this post


Link to post
Share on other sites
Guest

I just applied for a new account for my wife's new site a few days ago, and never received a confirmation that it was live. However, everything's working, so I haven't worried about it.

My suggestion is to just try enabling the module and see what happens.

Share this post


Link to post
Share on other sites
Guest Mrs. B.

Yes there is a delay, and you should receive an email when it is live, or yo can call the Phone number listed in the module and they might turn it on for you. However, if you were live and enable before, unless you changed your ID info, not sure it has to "go live" again ?

Any body have an answer for this quandry?

midwest B)

Thanks, Midwest. I have her on the lookout for a possible email. In the mean time I was on hold with them for a while yesterday when I had to hang up and planned to call back today.

No, we were never live before. This is a brand new company and website.

So I went to get the number from that page in CC Admin today to call the USPS, and am now getting an error message on the USPS config page where the number is at, saying

Security Warning Parsed array keys can not contain illegal characters! Script execution has been halted.

It may be possible to fix this error by deleting your browsers cookies and refresh this page.

:P

So then I upload the editconfig file I found a while back when I messed up the SSL settings to try and fix this new issue from there. Nothing I do in there is working, from disabling the USPS to enabling testing mode, to resetting the test, etc etc etc.

Officially discouraged now. B)

J.

Share this post


Link to post
Share on other sites
Guest topdotter

As mentioned by a number of posters already, there are quite a few of us out here that have never been live and are trying to do so.

It seems that many are getting the same results to running the tests that I've gotten. Namely, that the domestic tests are good, but the international tests are failing.

As a result of reading this thread I emailed USPS who enabled my account on their liveserver.

It seems the next step is where we all need help. Since our USPS module has never been enabled, it is still displaying

Status: Disabled <-- You MUST Submit USPS Tests Below to Enable.

I'm hoping someone can give us a pointer how to proceed at this point. I'd rather not have to mod files but if that's the only way...

In the class.usps file, I found the block

if($module['test']==1){

		$USPSURL = "http://testing.shippingapis.com/ShippingAPITest.dll";

		} else {

		$USPSURL = "http://production.shippingapis.com/ShippingAPI.dll";

		}

However, I don't know where the variable 'test' resides. Please help us all out.

Thanks,

Shmuel

Share this post


Link to post
Share on other sites
Guest

If the tests are not working for you, you may need to post some information about your setup for anyone to help you diagnose the problem.

I was able to get my wife's new site set up easily simply by uploading the new code Al provided and entering her username that was assigned by the USPS. Once those were done, the test went smoothly and I was able to Enable the module.

If it's not working for you, then there must be a difference in how your setup is configured (either in CubeCart or on the server) that needs to be addressed.

Share this post


Link to post
Share on other sites
Guest topdotter

If the tests are not working for you, you may need to post some information about your setup for anyone to help you diagnose the problem.

I was able to get my wife's new site set up easily simply by uploading the new code Al provided and entering her username that was assigned by the USPS. Once those were done, the test went smoothly and I was able to Enable the module.

If it's not working for you, then there must be a difference in how your setup is configured (either in CubeCart or on the server) that needs to be addressed.

Actually, I hadn't tried Al's fix because I thought it was still unfinished/untested. Since it's working for some, I'll give it a shot. What am I supposed to do with the DS_STORE files? I'm going to try without them. If that doesn't work I'll place them in the directories as well.

SK

Update: I uploaded the files without the DS_STORE files. I was able to get the USPS shipping module to be enabled. Everything seemed to be working until the first "Address" page in checkout. Only USPS shipping module is enabled, every other module, including free shipping is disabled. Nevertheless, by the shipping options, I see n/a. When I click "continue" I get a message that says "Failed to add the package". When I go and disable USPS and enable free shipping I'm able to complete checkout. I then uploaded the DS_STORE files and the same thing occurs. Any guess what I'm doing wrong?

SK

Update: Also, since I'm having this problem, I put my store to flat rate shipping. Though I typed in 1.99 when I configured the flat rate, when I'm checking out it shows 2.14...?!

Share this post


Link to post
Share on other sites
Guest

Okay, it seems like you're getting somewhere.

Within the USPS module configuration, which services do you have enabled?

I noticed on my sites that even with Flat Rate Priority, a set of box dimensions was required to get it to work. This isn't true for all services, but for the ones where box dimensions are requested, you may need to enter something.

I don't know what you're referring to by DS_STORES, so I can't comment on that. it's not in the fix that Al posted.

I haven't used flat rate shipping either, so I'm not sure what's happening there. Is it possible that your store is set for one currency and you're checking out with another?

Share this post


Link to post
Share on other sites
Guest topdotter

Okay, it seems like you're getting somewhere.

Within the USPS module configuration, which services do you have enabled?

I noticed on my sites that even with Flat Rate Priority, a set of box dimensions was required to get it to work. This isn't true for all services, but for the ones where box dimensions are requested, you may need to enter something.

I don't know what you're referring to by DS_STORES, so I can't comment on that. it's not in the fix that Al posted.

I haven't used flat rate shipping either, so I'm not sure what's happening there. Is it possible that your store is set for one currency and you're checking out with another?

I am quite concerned at this point that my problems with the shipping are due to shear stupidity. So here's the question: If USPS shipping is enabled, must I also enable one of the other options such as "per item", "by weight", etc.? Until now, I've only had the USPS module enabled as I've gone through checkout.

Share this post


Link to post
Share on other sites
Guest

I got curious about the comments regarding International shipping test not working, so I did a bit of investigation.

The files Al recently released do not show International tests 'out of the box', but have them commented out in the code. I uncommented them and ran the rate tests. As others have reported, they failed with an Authorization Error. Domestic tests run fine, but not International.

To further test this, I placed a test order on my site for a different country (Turkey). No rates showed up until I enabled Express Mail, then I got nine options in the shipping box, Express, Priority, First Class, and several variations of each. No other shipping services produce any rates in this case.

I'm not exactly sure what the problem here is, but there does seem to be an issue. I can keep Express Mail enabled in order to give my International customers a choice, but it seems a bit screwy to me.

Share this post


Link to post
Share on other sites
Guest midwest

Hi Folks,

I know awhile back I said I would post a step by step of what I did to get the International rates working in my store, and I am going to do that here.

Keep in mind that this DOES NOT relate to Al’s new module. I have not had the opportunity to try that out yet. If you are trying out Al’s new module, I recommend that you DO NOT add these mods to it, as I have no idea what the result will be.

This is a work around that myself and other members put together until the module was finished. I am still using them and as far as I am aware they are still working.

I cannot say for sure that these mods will work for any other CC version other than the one I am using.

This WILL NOT fix the “Authorization Error†you receive after you run the TEST, but this does not seem to affect the rate quotes.

So with all that said, here we go.

I am running CC Ver. 3.0.15

Killer Skin

1) Disable the USPS shipping module and turn off your store( I would also disable any other shipping modules). Log out of CC Admin. Clear your browser cache.

2) Do ABSOLUTLY NOTHING until you BACK UP YOUR CURRENT FILES listed below.

A) Go to your Host’s Control Panel for your site. Find these files and open (edit or view), one at a time, highlight the text (be careful here) , right click, COPY , then paste in a word Doc and SAVE AS “FILENAMEBU†Save to your desktop.

FILES AFFECTED:

/admin/modules/shipping/USPS/index.php

/modules/shipping/USPS/class.usps.php

/modules/shipping/USPS/calc.php.

:w00t: Now, if you HAVE NOT MODDED these files in the past, then you will only need to add the mods as indicated.

If you HAVE MODDED these files in the past, you will need to un-mod them, or, replace them with the files originally supplied with CC.

Make ABSOLUTLY certain you are uploading/correcting the correct files in the EXACT location specified. Some of the File name’s we are messing with are duplicated. One in ADMIN, the others in your Front-end.

4) You should now have CLEAN files installed.

5) Log back into CC Admin,

Enable USPS Shipping.

Enable one or more of the USPS Classes (Express, Priority, etc.).

Enable your Store.

6) Open a Browser and go to your store (not through the Admin). Log in and run a Domestic test order until you get to the shipping quotes dropdown box.( NOTE- you will see N/A under shipping until you get through the Address Confirmation page. This is Normal)

Now , Depending how many Shipping Options you enabled, you SHOULD see several quotes. BUT they will only be for FLAT RATE . We will fix that in a sec.

Next, run a International Test order. You might receive a whole slew of quotes. We will fix this as well.

THE FIX(S)

First, lets add a VARIBLE RATE container to your CC Admin. for USPS Priority and Express.

Before doing this, turn off your store and disable the USPS shipping module.

This first fix allows for variable rate domestic shipping based on weight when you use Priority Mail And Express Mail.

Originally posted by AllenT

Here is another way to accomplish the same thing, but leaving the option to switch to Flat Rate in the future.

First off, there is no need to edit calc.php with this method, as we are adding a new option to the USPS configuration.

To do this, open /admin/modules/shipping/USPS/index.php

1) Find:

<td valign="top" class="tdText"><select name="module[priorityContainer]">



Right after that, add :




<option value="Variable" <?php if($module['priorityContainer']=="Variable") echo "selected='selected'"; ?>>Variable Rate</option>



2) Find: 

 


<td valign="top" class="tdText"><select name="module[expressContainer]">



Right after that, add: 




<option value="Variable" <?php if($module['priorityContainer']=="Variable") echo "selected='selected'"; ?>>Variable Rate</option>



Save and upload.





















Next, open /modules/shipping/USPS/class.usps.php



3) Find: 

 


   //Check container for Express and Priority

			if(strtolower($attribs['service']) == 'express' || strtolower($attribs['service']) == 'priority')

			{

				if(!isset($attribs['container'])) {  $this->debug("USPS ERROR: Container for express or priority post was not set."); return false; }

				else {

					switch(strtolower($attribs['container']))

					{

						case 'flat rate envelope':

						case 'flat rate box':

							break;

						default:

							$this->debug("USPS ERROR: Container not recognised.");

							return false;

					}

				}

			}





and comment it out, as in:




/*			//Check container for Express and Priority

			if(strtolower($attribs['service']) == 'express' || strtolower($attribs['service']) == 'priority')

			{

				if(!isset($attribs['container'])) {  $this->debug("USPS ERROR: Container for express or priority post was not set."); return false; }

				else {

					switch(strtolower($attribs['container']))

					{

						case 'flat rate envelope':

						case 'flat rate box':

							break;

						default:

							$this->debug("USPS ERROR: Container not recognised.");

							return false;

					}

				}

			}

*/



4) Next, find: 




if(strtolower($attribs['service']) == 'express' || strtolower($attribs['service']) == 'priority') {



and replace it with:




if((strtolower($attribs['service']) == 'express' || strtolower($attribs['service']) == 'priority') AND (strtolower($attribs['container']) == 'flat rate envelope' || strtolower($attribs['container']) == 'flat rate box')) {
 





Save and upload.





5) Log back into CC Admin. You should now have Flat Rate and Variable Rate options listed for both Express and Priority. Now, you can select in the admin screen whether to use Flat Rate or Variable Rate. Note that you cannot use Variable and Flat Rate at the same time. You have to offer one or the other. 



6)  Enable the USPS Shipping module and your Store, and as before, log in and run a test order. 













Now lets fix the International Shipping.



Thanks goes to TimHensel for this fix !!

However, I only used THIS portion of his original post ( # 61 this thread) as that is what I needed. Please refer to his original post for more details and alter as your needs dictate.





"Also, here is a hard coded change I did which will only list the International shipping options I want to use:

(This is also in the modules\shipping\USPS\class.usps.php  file and not needed but it will get rid of all those flat rates and other odd methods)."



1)Find the line of code from:




else if(isset($xml['IntlRateResponse']))



all the way down to:




function get_rates($package_id = 0)



2) and change all that code in between to:




		else if(isset($xml['IntlRateResponse']))

		{

			//This is international data, so parse it accordingly

			

			$intshipping = array ( "Express Mail International (EMS)", "Priority Mail International", "First-Class Mail International" );





			$package_id = 0;



			if(isset($xml['IntlRateResponse']['#']['Package']['0']['#']['Error']))

			{

				$x_errorDesc = $xml['IntlRateResponse']['#']['Package']['#']['Error'];

				$this->current_result[$package_id]['Error']['Description'] = $x_errorDesc;

			}

			else if(isset($xml['IntlRateResponse']))

			{

				$x_postage = $xml['IntlRateResponse']['#']['Package']['0']['#']['Service'];



				for($i=0; $i < count($x_postage); $i++)

				{

					$x_mailservice = $x_postage[$i]['#']['SvcDescription']['0']['#'];

					$x_rate = $x_postage[$i]['#']['Postage']['0']['#'];

					$service = $x_postage[$i]['#']['SvcDescription']['0']['#'];

					

					if ( $service == $intshipping[0] or $service == $intshipping[1] or $service == $intshipping[2] )

						{ 

							$this->current_result[$package_id]['Postage'][$x_mailservice] = $x_rate;

						}

						

#					echo "MailService = ".$x_mailservice."<br>";

#					echo "Rate = ".$x_rate."<br>";

					

//					$this->current_result[$package_id]['Postage'][$x_mailservice] = $x_rate;

				} 

			}

		}



		return true;

	}



	function get_rates($package_id = 0)

3) Save and upload

This will now only display the three shipping methods listed in $intshipping= array( found in the 3rd line in this code) with in your cart.

You may add/delete services with in the array as your particular shipping needs dictate.

But for now . Leave them until you run the test orders.

4) As before, Log into Admin, Enable the USPS Module, Enable a shipping option, turn on the Store, and run a International Test order. You should now only have quotes for the methods listed in the $intshipping= array.

You should now have Domestic and International Shipping quotes available for your customers.

I make no guarantees that these will work in your store, but they are working in mine.

I have no idea how these mods will effect other mods you have in your store.

However- I hope these are of some help to those having difficulties.

I will be trying out Al’s new Module in a few day’s.

midwest B)

Share this post


Link to post
Share on other sites
Guest midwestdedicated

We have tried Midwests changes, and have also tried to upload the files provided by AI. In each occurance we get different XML errors from USPS. This is the error from Midwests changes. Domestic seems to work fine. International shipping is dead in the water. Considering the store in question services 60 countries this is BAD news. I hope CC has a fix for it soon. I would pay almost anything to get this fixed for our client.

Request XML:

--------------------------------------------------------------------------------

<IntlRateRequest USERID="OURUSERID" PASSWORD="OURPASSWORD"></IntlRateRequest>

--------------------------------------------------------------------------------

Return XML:

--------------------------------------------------------------------------------

<?xml version="1.0"?>

<Error><Number>-2147219084</Number><Source>IntlRate_Respond;SOLServerRates.IntlRate_Respond</Source><Description>Invalid XML Element cannot be empty according to the DTD/Schema.

</Description><HelpFile></HelpFile><HelpContext>1000440</HelpContext></Error>

Share this post


Link to post
Share on other sites

Hi guys. I see USPS have finally released their RateV3 Documentation. I'm going to go over it with a fine toothed comb and get this nailed once and for all.

p.s. DS_STORES shouldn't be uploaded. Its a Mac system file and it shouldn't have got into the archive. I'm a newbie to Macs which the office is kitted with now. ;)

Share this post


Link to post
Share on other sites
Guest cuber1

Hi,

Have just installed CubeCart Version: 3.0.17.

The USPS is a bit messed up. (I installed free version, didn't buy the full yet. )

I see a lot of discussion on this subject.

So wanted to ask does the new version includes all of the modifications/updates necessary for USPS shipping module to work properly(including International) or do I still need to "worship" over it to bring it up to par?

Some of the features, when enabled, spit out code with userid/pass for USPS and some spit out "Failed to add the package", some do work.

Does it work or do I need to add/remove/modify something??? If yes. What?

Appreciate all replies.

Share this post


Link to post
Share on other sites

×
×
  • Create New...