Jump to content
bad_lemming

[Contribution] - USPS Methods

Recommended Posts

I just installed USPS Methods 2.9.5, I followed all the instructions and reinstalled the module but now I cannot edit the module to put in my USPS information. Any ideas why this may be happening???

Share this post


Link to post
Share on other sites
Disregard this post ... still stuck! :(

 

is there no edit button? please describe exactly what happens. thanks!

 

Scott

Share this post


Link to post
Share on other sites
I can click on edit - but then it send me to https://www.minervasportswear.com/ihsa/stor...amp;action=edit and says the web page cannot be displayed.

 

sounds like the usps.php file is corrupted. try removing the usps module, reuploading, re-installing, and see what happens. thanks!

 

Scott

Share this post


Link to post
Share on other sites

Oops, I had put the shipping module usps.php file over the language one that time.

 

Alright, it's letting me edit now, I guess there was just an error the last time I tried to install.

 

Thanks!! :)

Share this post


Link to post
Share on other sites
Oops, I had put the shipping module usps.php file over the language one that time.

 

Alright, it's letting me edit now, I guess there was just an error the last time I tried to install.

 

Thanks!! :)

 

Great!

Share this post


Link to post
Share on other sites

Hi, I just wanted to thank you for this contribution... just installed it and it is working just fine...

 

I did have a "can't resend headers" error with the functions/general.php file, and found that the call was already inserted from the Header Tags Controller contribution. I took out that snippet, and did a fresh install of the module and all was well. If somebody has the same problem and you are running Header Tags, see if you have a duplicate in functions/general.php file of this code:

 

function tep_cfg_select_multioption($select_array, $key_value, $key = '') {

for ($i=0; $i<sizeof($select_array); $i++) {

$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');

$string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';

$key_values = explode( ", ", $key_value);

if ( in_array($select_array[$i], $key_values) ) $string .= ' CHECKED';

$string .= '> ' . $select_array[$i];

}

$string .= '<input type="hidden" name="' . $name . '" value="--none--">';

return $string;

}

 

Hope this helps somebody, and thanks again!

Janet

Share this post


Link to post
Share on other sites

Hello,

 

How can I modify the usps.php so that when no international shipping methods selected, the USPS shipping option doesn't even appear on checkout_shipping.php page? Right now I have the USPS module enabled but do not allow international shipping, so on checkout_shipping.php page it shows:

United States Postal Service

An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner.

Thanks.

Share this post


Link to post
Share on other sites
Hello,

 

How can I modify the usps.php so that when no international shipping methods selected, the USPS shipping option doesn't even appear on checkout_shipping.php page? Right now I have the USPS module enabled but do not allow international shipping, so on checkout_shipping.php page it shows:

 

Thanks.

 

It's good to hear from you Irin. I'll take a stab at helping.

In the version with insurance, the international rates are fetched and returned from lines 426 to 464.

The error logic is just before that in 419 to 425.

 

The easiest way would be to add this line in includes/languages/xxxxx/usps.php:

define('MODULE_SHIPPING_USPS_TEXT_ERROR_1', 'We do not offer International Shipping via the United States Postal Service at this time.');

 

This in the modules/usps.php before line 168 add:

		 if ($order->delivery['country']['id'] != SHIPPING_ORIGIN_COUNTRY) {
	   $this->quotes = array('module' => $this->title,
					'error' => MODULE_SHIPPING_USPS_TEXT_ERROR_1);
	 }else{

 

After line 169 add this:

		 }

 

so that it looks like this:

	  } else {
	 if ($order->delivery['country']['id'] != SHIPPING_ORIGIN_COUNTRY) {
	   $this->quotes = array('module' => $this->title,
					'error' => MODULE_SHIPPING_USPS_TEXT_ERROR_1);
	 }else{
	   $this->quotes = array('module' => $this->title,
					'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);
	}
  }

 

This isn't what you were looking for, but it might be a start?

 

Scott

Edited by olsonsp4c

Share this post


Link to post
Share on other sites

Hi, Scott. It's nice having you supporting this contribution. Thanks for the code you posted above, it might be an alternative. I have another kind of problem, though. The USPS Global Express Guaranteed is not calculated correctly as it doesn't take the box dimensions into consideration. If I ship the 18x14x4 Box with contents weight 3 LBS to UK, the calculated Dimensional Weight is (18x14x4/166) or 7.0 lbs at the cost of $81.90 (@ USPS web site). Although, on my checkout_shipping.php I get a rate of $66.50. I'm loosing the $15.40 on this shipping. Is there any workaround to take the dimensional support into consideration just like the UPS XML module does? I know it might be a lot of work to implement it, but it worth it.

 

Thanks.

Share this post


Link to post
Share on other sites
Hi, Scott. It's nice having you supporting this contribution. Thanks for the code you posted above, it might be an alternative. I have another kind of problem, though. The USPS Global Express Guaranteed is not calculated correctly as it doesn't take the box dimensions into consideration. If I ship the 18x14x4 Box with contents weight 3 LBS to UK, the calculated Dimensional Weight is (18x14x4/166) or 7.0 lbs at the cost of $81.90 (@ USPS web site). Although, on my checkout_shipping.php I get a rate of $66.50. I'm loosing the $15.40 on this shipping. Is there any workaround to take the dimensional support into consideration just like the UPS XML module does? I know it might be a lot of work to implement it, but it worth it.

 

Thanks.

 

I'll look into Irina, it's a good suggestion. If you have any input in the process of revising this, let me know - there might be a way to incorporate some of the code from the UPS addon to make it functional...

 

Scott

Share this post


Link to post
Share on other sites

I'm having trouble with the contribution and would appreciate any help you can give.

 

I'm using PayPal Express Checkout, and when returning to my site from PayPal, I get the following error:

 

"Fatal error: Cannot instantiate non-existent class: httpclient in /home/endpape/public_html/includes/modules/shipping/usps.php on line 269"

 

I've updated the SQL, reinstalled the module several times, still, no luck!

Share this post


Link to post
Share on other sites

I switched to PayPal IPN 2.3.3 and USPS Methods seems to be working. If anyone has an answer to that question above, I'd still like to hear it!

Share this post


Link to post
Share on other sites
I'll look into Irina, it's a good suggestion. If you have any input in the process of revising this, let me know - there might be a way to incorporate some of the code from the UPS addon to make it functional...

 

Scott

Hi Scott. All I can say is that since Version 1.3.0 of the UPS XML module the dimensional support was mooved to a separate class, so it can be used in other modules too. The packaging routines are instantiated when the page checkout_shipping is called. The files needed for dimensional support and packaging addition from the UPS XML module are catalog/includes/classes/packing.php and catalog/admin/packaging.php. The dimensional support can be enabled in admin->Configuration->Shipping/Packaging. There is also a Package Definition interface in Admin->Tools->Packaging where various package dimensions can be created. The packing algorithm will load boxes with product and return quotes based on the size and dimensions of those boxes. The products length, width, and height can be specified in the administrative interface when editing a product. These variables must be added to the catalog/includes/classes/shopping_cart.php. I think that we'll also need to compare two files includes/modules/shipping/usps.php and includes/modules/shipping/upsxml.php to see if there is anything for the dimensional support in the upsxml.php.

Share this post


Link to post
Share on other sites
Hi Scott. All I can say is that since Version 1.3.0 of the UPS XML module the dimensional support was mooved to a separate class, so it can be used in other modules too. The packaging routines are instantiated when the page checkout_shipping is called. The files needed for dimensional support and packaging addition from the UPS XML module are catalog/includes/classes/packing.php and catalog/admin/packaging.php. The dimensional support can be enabled in admin->Configuration->Shipping/Packaging. There is also a Package Definition interface in Admin->Tools->Packaging where various package dimensions can be created. The packing algorithm will load boxes with product and return quotes based on the size and dimensions of those boxes. The products length, width, and height can be specified in the administrative interface when editing a product. These variables must be added to the catalog/includes/classes/shopping_cart.php. I think that we'll also need to compare two files includes/modules/shipping/usps.php and includes/modules/shipping/upsxml.php to see if there is anything for the dimensional support in the upsxml.php.

 

Thanks Irina, appreciate the insight, would love any help and expertise you can provide on improving this addon, really appreciate the direction.

 

Scott

Share this post


Link to post
Share on other sites

It has come to my attention from several users, that the USPS Methods contribution may be conflicting with the new Paypal Express module that just came out. I have not looked into this, just be aware...

 

Scott

Share this post


Link to post
Share on other sites

Hi Scott,

 

This may sound a bit uhm... silly but I was wondering about a possible upgrade from my USPS Methods 2.9.2 Upper Case Fix2.

I am running a MS2 2.2 shop and don't plan on upgrading with the RC versions until the final 2.2 release. I am going to be upgrading the standard PayPal module with the PayPal IPN and I am using PayPal's Website Payments Standard. I am only offering Domestic USPS shipping with options of Parcel Post, Priority, and Express.

 

One problem I am trying to resolve would be the inclusion of shipping insurance and possibly signature confirmation. Right now I have them added into the handling fee which of course isn't a very good way of doing it.

 

I read thru the USPSMethods 2.9.6 installation.txt and it states it is intended for RC1. I'm a little unclear as to which Methods version I should use - 2.9.6 or 2.9.2+Insurance?

 

Also I don't know if it is a glitch with my install or not or because I do not offer international shipping, but I have never been able to display transit times. Any idea why?

 

Any guidance on this for a trouble free update would truely be appreciated. ;)


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites
Hi Scott,

 

This may sound a bit uhm... silly but I was wondering about a possible upgrade from my USPS Methods 2.9.2 Upper Case Fix2.

I am running a MS2 2.2 shop and don't plan on upgrading with the RC versions until the final 2.2 release. I am going to be upgrading the standard PayPal module with the PayPal IPN and I am using PayPal's Website Payments Standard. I am only offering Domestic USPS shipping with options of Parcel Post, Priority, and Express.

 

One problem I am trying to resolve would be the inclusion of shipping insurance and possibly signature confirmation. Right now I have them added into the handling fee which of course isn't a very good way of doing it.

 

I read thru the USPSMethods 2.9.6 installation.txt and it states it is intended for RC1. I'm a little unclear as to which Methods version I should use - 2.9.6 or 2.9.2+Insurance?

 

Also I don't know if it is a glitch with my install or not or because I do not offer international shipping, but I have never been able to display transit times. Any idea why?

 

Any guidance on this for a trouble free update would truely be appreciated. ;)

 

Thanks for the note. 2.9.6 should work on MS2, RC1, and hopefully RC2 (though I haven't gone there yet personally :) I'd recommend upgrading and it should fix the issues you are having. 2.9.6 includes the option of insurance; however, it is turned either ON or OFF in the ADMIN for all rate quotes, so be aware of that. One option for signature confirmation is to modify another contribution to add another part of the checkout_shipping.php page where, if they check the box, it will add the amount to the total, or something similar. That is about as much direction as I can give you at this point - I'd actually love to mod this addon to add other options that the usps offers like Flat Rate USPS Priority shipping boxes, etc...

 

thanks.

Scott

Share this post


Link to post
Share on other sites
Thanks for the note. 2.9.6 should work on MS2, RC1, and hopefully RC2 (though I haven't gone there yet personally :) I'd recommend upgrading and it should fix the issues you are having. 2.9.6 includes the option of insurance; however, it is turned either ON or OFF in the ADMIN for all rate quotes, so be aware of that. One option for signature confirmation is to modify another contribution to add another part of the checkout_shipping.php page where, if they check the box, it will add the amount to the total, or something similar. That is about as much direction as I can give you at this point - I'd actually love to mod this addon to add other options that the usps offers like Flat Rate USPS Priority shipping boxes, etc...

 

thanks.

Scott

 

Thank you Scott :thumbsup:

I just wanted to make sure 2.9.6 was compatable with my MS2 before I broke it again LOL.

 

Thanks for the tip, I will make sure to turn ON the insurance in Admin. I'm not giving my customers the choice of insurance or signature confirmation, it's included as a precaution to cover my butt. Having it included with the handling fee though just bumped the shipping cost up without explaination unless the customer read my Shipping & Return policy.

 

A biggy I'm sure you are aware of that would be a nice feature included is somehow to calculate oversized boxes. I'll be running into that problem when I go live. I sell mostly plastic model kits where the combined boxes go beyond the 108 inches but are well below the 70 pounds. :huh:

 

Thanks again Scott!


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

I have the same issue , when i try to edit the USPS in the admin i get this error

 

Parse error: syntax error, unexpected T_GLOBAL, expecting ')' in /home/abc/public_html/admin/modules.php(217) : eval()'d code on line 1

 

Any help ? I know there was a fix not sure where it is in the community board...

 

Any solutions to this from anyone? I too find parcel coming out higher.

 

Scott: Thanks for your fix on the parse error. After changing the type to text and rerunning the sql code it all works. Does anyone know what we are supposed to do with the instructions.php file that is included in usps methods latest version? The installation instructions do not address it. The installation instructions also do not address running the sql file or when to do it.

 

Scott thanks again.

 

Jim

Share this post


Link to post
Share on other sites
I have the same issue , when i try to edit the USPS in the admin i get this error

 

Parse error: syntax error, unexpected T_GLOBAL, expecting ')' in /home/abc/public_html/admin/modules.php(217) : eval()'d code on line 1

 

Any help ? I know there was a fix not sure where it is in the community board...

 

This is addressed in the Troubleshooting part of the installation file.

 

Scott

Share this post


Link to post
Share on other sites
I'm having trouble with the contribution and would appreciate any help you can give.

 

I'm using PayPal Express Checkout, and when returning to my site from PayPal, I get the following error:

 

"Fatal error: Cannot instantiate non-existent class: httpclient in /home/endpape/public_html/includes/modules/shipping/usps.php on line 269"

 

I've updated the SQL, reinstalled the module several times, still, no luck!

I had that problem also and found that if you add the following just before line 269 in usps.php it fixes the problem:

	  if (!class_exists('httpClient')) {
	include('includes/classes/http_client.php');
  }

I got that code from the USPS module included with 2.2rc2

 

Sean

Share this post


Link to post
Share on other sites
I had that problem also and found that if you add the following just before line 269 in usps.php it fixes the problem:

	  if (!class_exists('httpClient')) {
	include('includes/classes/http_client.php');
  }

I got that code from the USPS module included with 2.2rc2

 

Sean

 

Thanks, I will add that to the documentation.

 

Scott

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

×