Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Module Help Please!


Guest

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?

Link to comment
Share on other sites

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
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?

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

  • 4 months later...

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.

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 2 years later...

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...