Jump to content

FIX PRIORITY VARIABLE, & FIRST CLASS RATES


Guest tuffdude

Recommended Posts

Guest tuffdude

I worked on this for a couple hours before I got everything working. But these 3 steps fixed the modules I wanted to use Parcel, Priority, and First Class !!!!

Thanks so much to Al, Alan T, and donniedj !!!!! :yeahhh:

Step 1 : (I don't know if this step was necessary, but I did it and everything's great) Thanks to Al

Backup, then install the zip in this post; Al's USPS v4_zip

Step 2 : (This fixes the Priority to allow the variable shipping by weight) Thanks go to Alan T

In /modules/shipping/USPS/class.usps.php, around line 351, change

$this->request_xml .= '<Container>' . strtoupper($attribs['container']) . '</Container>';




to




if(strtoupper($attribs['container']) == 'FLAT RATE BOX' || strtoupper($attribs['container']) == 'FLAT RATE ENVELOPE'){

	$this->request_xml .= '<Container>' . strtoupper($attribs['container']) . '</Container>';

}




Now we can set either Flat Rate OR Variable Rate and get real-time quotes.



Too bad we can't get both at the same time.





Step 3 : (This fixes the USPS First Class Bug)  Thanks go to donniedj



$module['FirstClassSize'] should be

$module['serviceFirstClass']



In /modules/shipping/USPS/calc.php, around line 102,

change




$package = array(

				'service' => 'FIRST CLASS',

		'size' => $module['FirstClassSize'],

		'mail_type' => "Package",

		'first_class_mail_type' => $module['FirstClassMailType'],

		'machinable' => $module['FirstClassMachineable']

		);




to




$package = array(

		'service' => 'FIRST CLASS',

		'size' => $module['serviceFirstClass'],

		'mail_type' => "Package",

		'first_class_mail_type' => $module['FirstClassMailType'],

		'machinable' => $module['FirstClassMachineable']

		);

This really should be STICKIED, it would save some people like me alot of time, and confusion !!!!

:)

Link to comment
Share on other sites

  • 3 weeks later...

Guest Klutzys

Hi, I just wanted to clarify that this works with CCV3 as this article tells us to install the Al's USPS v4_zip.

Thanks,

Tammy

I worked on this for a couple hours before I got everything working. But these 3 steps fixed the modules I wanted to use Parcel, Priority, and First Class !!!!

Thanks so much to Al, Alan T, and donniedj !!!!! :yeahhh:

Step 1 : (I don't know if this step was necessary, but I did it and everything's great) Thanks to Al

Backup, then install the zip in this post; Al's USPS v4_zip

Step 2 : (This fixes the Priority to allow the variable shipping by weight) Thanks go to Alan T

In /modules/shipping/USPS/class.usps.php, around line 351, change

$this->request_xml .= '<Container>' . strtoupper($attribs['container']) . '</Container>';




to




if(strtoupper($attribs['container']) == 'FLAT RATE BOX' || strtoupper($attribs['container']) == 'FLAT RATE ENVELOPE'){

	$this->request_xml .= '<Container>' . strtoupper($attribs['container']) . '</Container>';

}




Now we can set either Flat Rate OR Variable Rate and get real-time quotes.



Too bad we can't get both at the same time.





Step 3 : (This fixes the USPS First Class Bug)  Thanks go to donniedj



$module['FirstClassSize'] should be

$module['serviceFirstClass']



In /modules/shipping/USPS/calc.php, around line 102,

change




$package = array(

				'service' => 'FIRST CLASS',

		'size' => $module['FirstClassSize'],

		'mail_type' => "Package",

		'first_class_mail_type' => $module['FirstClassMailType'],

		'machinable' => $module['FirstClassMachineable']

		);




to




$package = array(

		'service' => 'FIRST CLASS',

		'size' => $module['serviceFirstClass'],

		'mail_type' => "Package",

		'first_class_mail_type' => $module['FirstClassMailType'],

		'machinable' => $module['FirstClassMachineable']

		);

This really should be STICKIED, it would save some people like me alot of time, and confusion !!!!

:whistle:

Link to comment
Share on other sites

  • 1 month later...
Guest cardhost

Works great, but I just found something that needs to be fixed.

When you have both USPS Priority Mail and USPS Express Mail enabled... At checkout, you do not have the option to choose from one or the other. The cart only gives you the USPS Express Mail price. What if you do not want to pay for USPS Express Mail and want the USPS Priority Mail option?????

Link to comment
Share on other sites

Guest Klutzys

After making these changes and going through checkout this is the error message I get:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home1/midwesv9/public_html/modules/shipping/USPS/class.usps.php on line 575

Here is what my line 575 says:

?>

I didn't change anything at the bottom....any ideas??

Tammy

Link to comment
Share on other sites

Guest cardhost

After making these changes and going through checkout this is the error message I get:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home1/midwesv9/public_html/modules/shipping/USPS/class.usps.php on line 575

Here is what my line 575 says: ?>

I didn't change anything at the bottom....any ideas??

Tammy

Check your modifications. That is telling you that there is an extra ; somewhere.

Scott

Link to comment
Share on other sites

  • 3 weeks later...
Guest djpezo

I tried this fix as well and now USPS first class is not working for me. I calculate shipping based on weight and all of my products are less than 1 lb so my weights are 0.32, etc. (I converted the oz. to lbs.). The error I am getting is "USPS Error: Size not recognized". Can anyone help me, please?

Thank you,

Diane

Link to comment
Share on other sites

Guest cardhost

I tried this fix as well and now USPS first class is not working for me. I calculate shipping based on weight and all of my products are less than 1 lb so my weights are 0.32, etc. (I converted the oz. to lbs.). The error I am getting is "USPS Error: Size not recognized". Can anyone help me, please?

Thank you,

Diane

You have to round it up to the next nearest pound.

Link to comment
Share on other sites

  • 1 month later...
Guest Champs

Could you be more specific about what "it" is? I see only whole numbers when I dump the contents of $module under the FirstClass case.

EDIT: The admin interface says that 13oz. is the package size limit anyway, so that should be (kind of) a problem if you pass a weight of 1lb... but however appropriate that size is, and I don't think it is, that kind of exception should only disable the First Class option instead of stopping the show.

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
Guest ElliottDennis

I tried this fix as well and now USPS first class is not working for me. I calculate shipping based on weight and all of my products are less than 1 lb so my weights are 0.32, etc. (I converted the oz. to lbs.). The error I am getting is "USPS Error: Size not recognized". Can anyone help me, please?

Thank you,

Diane

:innocent::innocent::innocent:

__________________________________________________

Nissan shocks andstruts

Toyota quick strut

Toyota shocks and struts

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