Jump to content
Sign in to follow this  
primordialstuff

USPS Module Help Please!

Recommended Posts

I'm having this same issue. I have reinstalled the module from scratch - multiple times. I have read every link that has been posted, and tried every fix. I have changed the set_function to text.

 

Nothing makes a difference. If I have parcel, express, and priority selected to be available, it doesn't matter what the customer chooses, on the last page it reverts to express.

 

If I remove express as an option ... then it goes to priority or whatever option is the most expensive.

 

It's driving me nutty. :(

 

Any ideas? And yes, everything is capped that should be capped.

 

 

I also did change the set_function to text, etc etc.

 

It pulls the correct rates for shipping, but it flips to a higher ship[ping rate after you hit continue. I've been trying very hard to make this work for the past 2 weeks and tried everything, but for me, it's the switching part that doesn't seem to be addressed much in this thread. I see a lot of the other issues addressed, but not much it seems like for the shipping type switching during the checkout phase.

 

Or am I missing something?

Share this post


Link to post
Share on other sites
I also did change the set_function to text, etc etc.

 

It pulls the correct rates for shipping, but it flips to a higher ship[ping rate after you hit continue. I've been trying very hard to make this work for the past 2 weeks and tried everything, but for me, it's the switching part that doesn't seem to be addressed much in this thread. I see a lot of the other issues addressed, but not much it seems like for the shipping type switching during the checkout phase.

 

Or am I missing something?

Guess not. Steve Lionel pointed out to me that if you hit continue it really does all the things of getting a quote from UPS or USPS again. In the latest UPS XML 1.3.0 in step 11 of the readme.txt there is some code to prevent that getting the rates again and pulling it from the quotes saved in a session variable. Although it does not really fix the issue it might circumvent the problem.

Share this post


Link to post
Share on other sites
Guess not. Steve Lionel pointed out to me that if you hit continue it really does all the things of getting a quote from UPS or USPS again. In the latest UPS XML 1.3.0 in step 11 of the readme.txt there is some code to prevent that getting the rates again and pulling it from the quotes saved in a session variable. Although it does not really fix the issue it might circumvent the problem.

 

 

I keep seeing that contribution being offered as a solution, but I don't wish to use UPS - I want to use USPS.

 

UPS is United Parcel Service, while USPS is United States Postal Service - so it didn't seem to me that an UPS contrib would be a solution for a US Postal service contrib offhand.

 

Or is the UPS contrib just missing a "s" and therebuy is actually a USPS contrib and would send packages not through UPS but through USPS??

 

Or am I misunderstanding something?

Share this post


Link to post
Share on other sites

alyssa: I think he was trying to say that there may be knowledge to be garnered from the UPS contrib that, correctly and creatively applied, may enable you to fix the USPS contrib.

 

Thanks for the hint by the way, will look at that to see if that solves more than one of my current problems.

 

As far as the logic goes, the shipping rates are indeed pulled twice, rather than saved. Which really messes things up on occasion ... Just like attributes are looked up when they are transferred from basket to order, another pitfall that sabotaged one of my down&dirty fixes ... :-"


Even at a Mensa convention someone is the dumbest person in the room.

Share this post


Link to post
Share on other sites
alyssa: I think he was trying to say that there may be knowledge to be garnered from the UPS contrib that, correctly and creatively applied, may enable you to fix the USPS contrib.

 

Thanks for the hint by the way, will look at that to see if that solves more than one of my current problems.

 

As far as the logic goes, the shipping rates are indeed pulled twice, rather than saved. Which really messes things up on occasion ... Just like attributes are looked up when they are transferred from basket to order, another pitfall that sabotaged one of my down&dirty fixes ... :-"

 

 

Yeah ... it bites a little but such is life with open source lol.

 

I convinced the person whose store I was doing that a good workaround for the immediate here and now was to just not offer any shopping choices except priority.

 

I just started from scratch on a new untouched store 2 more times and got the same result - I can get it to work on all areas, except prevent it from switching at the very end. :huh: So ... just not sure what else I could do with it as none of the fixes seemed to resolve that for me.

 

Must be something else it would work, as I see others got it to work.

Share this post


Link to post
Share on other sites
I keep seeing that contribution being offered as a solution, but I don't wish to use UPS - I want to use USPS.

 

Or am I misunderstanding something?

Yes, as Tobias already pointed out. There are some pieces of code in the readme.txt of the UPS XML contribution that could be added to any shop and which hopefully would circumvent the problem:

----------------------------
STEP 11 ** OPTIONAL **
----------------------------

Steve Lionel (stevel) pointed out that checkout_shipping.php does the whole get quote procedure (contacting the website for shipping quotes like USPS, UPS, FedEx etcetera) again on pressing the Continue button (action=process). Since that is rather a time waste and waste of resources you can add the following code to avoid this

File: checkout_shipping.php

Line 110-115

**REPLACE**

	  if ($shipping == 'free_free') {
		$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
		$quote[0]['methods'][0]['cost'] = '0';
	  } else {
		$quote = $shipping_modules->quote($method, $module);
	  }

**WITH**

	  if ($shipping == 'free_free') {
		$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
		$quote[0]['methods'][0]['cost'] = '0';
	  } else { // not free shipping
		// check if the cart and send to address haven't changed in the mean time
		 if (isset($_SESSION['shipping_quotes']) && $_SESSION['shipping_quotes']['cartID'] == $cartID && $_SESSION['shipping_quotes']['sendto'] == $sendto) {
		  foreach ($_SESSION['shipping_quotes']['quotes'] as $array_key => $shipping_quote) {
			if ($shipping_quote['id'] == $module) {
			  foreach ($shipping_quote['methods'] as $subarray_key => $method_array) {
				if ($method_array['id'] == $method) {
				   $quote[] = array('id' => $module, 'module' => $shipping_quote['module'], 'methods' => array($method_array));
				   break;
				} // end if ($method_array['id'] == $method)
			  } // end foreach ($shipping_quote['methods'] as $subarray_key => $method_array)
			  break; // found shipping quote in session
			} // end if ($shipping_quote['id'] == $module)
		  } // end foreach ($_SESSION['shipping_quotes']['quotes']...
// if for some reason the quote is not found in the session so $quote is not set here we get our quotes again
		  if (!isset($quote)) {
			$quote = $shipping_modules->quote($method, $module);
		  } // end if (!isset($quote))
		} else { 
		$quote = $shipping_modules->quote($method, $module);
		 }
	  }

Line 138-139

**REPLACE**

// get all available shipping quotes
 $quotes = $shipping_modules->quote();

**WITH**

// get all available shipping quotes
 $quotes = $shipping_modules->quote();
 if (!tep_session_is_registered('shipping_quotes')) tep_session_register('shipping_quotes');
 $shipping_quotes = array('cartID' => $cartID, 'sendto' => $sendto, 'quotes' => $quotes);

Additionally it will need to be unset in checkout_process.php. Find line 270-275 and the indicated line:

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('shipping_quotes'); // add this line
 tep_session_unregister('payment');
 tep_session_unregister('comments');


What is does is just store the shipping quotes received in a session variable (so the customer cannot change it) and then access the session variable on action=process instead of getting the quotes again.

Share this post


Link to post
Share on other sites

We are working on getting this USPS module install but are having some problems.

Could someone please post a screen shot showing the admin page that lets you pick the different shipping options.

Share this post


Link to post
Share on other sites
We are working on getting this USPS module install but are having some problems.

Could someone please post a screen shot showing the admin page that lets you pick the different shipping options.

 

:lol: :-" chopmaster, that response isn't directed at you. I wish you luck. the response was related to my experience here, then your first post here.

Edited by makeit4me

Share this post


Link to post
Share on other sites

I have a quick question. I tried to do the SQL updates, but I took a look at my database and there is no configuration_key that equals 'MODULE_SHIPPING_USPS_TYPES' in the configuration table. Am I missing something?

 

Any help would be greatly appreciated, because I can't get my shipping module to work. Thanks.

Share this post


Link to post
Share on other sites

I copied the php files into the directory and I ran the sql commands.

 

I get the following error:

 

Fatal error: Cannot redeclare class usps in domain/catalog/includes/modules/shipping/usps.php on line 16

 

Any tips are greatly appreciated.

 

Thanks,

Patrick

Share this post


Link to post
Share on other sites

Hi,

 

it looks like there is a bug in the latest usps.php (USPS Methods 2.9.2 Upper Case Fix2+insurance) in line 209. This line need to be commented out since line 210 is the correct one. Otherwise you will end up having two records in the db and you get the wrong one by default.

 

Nevertheless has someone noticed that the PARCEL rates are wrong? For a 2lb parcel from zip to zip 94551 it gives me $6.67 where the USPS Postage Rate Calculator gives me $4.34 - Can anyone confirm that?

 

Thanks.

 

Hi,

I just installed OSC, V2.2 RC2.

I'm having the same issue: product weight =0.5 lbs shipping from/to same state, same zip range: within 5 miles.

USPS calculates Express 13.65, First Class 2.41, Priority 4.90, parcel post 4.90 Obviously goofy rates. Parcel more than first class?? Priority and Parcel post same rate??? USPS webtools support will not help, they off it to OSC issues. Can't find an answer on this anywhere. Anyone out there that can help both of us?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×