Jump to content

Need regular USPS priority, not USPS Priority Flat Rate.


Guest blueveil

Recommended Posts

Guest blueveil

Fixed problems with USPS test, and Godaddy Hosting, But.......

I get usps Priority mail Flat rate box to select in the shipping admin,

BUT no option for standard priority mail tyveck envleope or box.

Is there any way to add that option?

Is this something I can add to the php file?

Or maybe I am just out to lunch, and didn't see the option.

I ship all my packages USPS priority mail, but not in the flat rate box, or envelope.

This would clinch the deal, and I could feel confident enough to buy the license.

Thank you in advance.

Ed.

Link to comment
Share on other sites

The problem we're running into is that the USPS site doesn't seem to want to give rates for regular Priority Mail. Flat Rate is the only one they want to offer us.

Link to comment
Share on other sites

I just posted this in another thread, but wanted to make sure to maintain continuity where possible.

Variable rates are available once we eliminate the <container> tag from the rate request. This means that the code will have to be edited to make that a conditional thing, sent only when using Flat Rate, but not sent when using Variable Rates.

I've tested the following, and IT WORKS!!

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.

Link to comment
Share on other sites

  • 1 month later...
Guest swifty

I just posted this in another thread, but wanted to make sure to maintain continuity where possible.

Variable rates are available once we eliminate the <container> tag from the rate request. This means that the code will have to be edited to make that a conditional thing, sent only when using Flat Rate, but not sent when using Variable Rates.

I've tested the following, and IT WORKS!!

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.

will this work to remove "Flat Rate Envelope" from express mail too?

Link to comment
Share on other sites

Guest swifty

I just posted this in another thread, but wanted to make sure to maintain continuity where possible.

Variable rates are available once we eliminate the <container> tag from the rate request. This means that the code will have to be edited to make that a conditional thing, sent only when using Flat Rate, but not sent when using Variable Rates.

I've tested the following, and IT WORKS!!

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.

will this work to remove "Flat Rate Envelope" from express mail too?

i tried this and it didn't work for me but i found this.

check it out

i'm still waiting for a reply to my post as to whether or not i can apply it to "Express Mail".

Link to comment
Share on other sites

  • 2 weeks later...
Guest Dragonspearls

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.

Just tried this, and get the following:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION on line 574

Line 574 is the end of file (?>).

And class.php did not have "strtoupper($attribs['container'])" it had ($attrib['container']). Not sure if that matters or not since I'm not really a programmer (I know enough to break a lot of pages :) ).

Can anyone help with this please? I'd really like an option other than Flat Rate (at least right now ... being female, I reserve the right to change my mind at some point in the future).

Carol

Link to comment
Share on other sites

Guest Dragonspearls

I just finished "starting over" on this issue. I went to the unzipped .17 upgrade, and re-uploaded the files in the USPS shipping module to my cart. The I changed the code as suggested above. YAY!! IT WORKED!! I just must've have been way to tired last yesterday/last night and was missing something.

So I don't have to do Flat Rate EXCEPT for the fact that CubeCart doesn't have a way for me to add in a starting box weight to which my products' weights are added. Without that, all shipping calculations for USPS are inaccurate, except in the case of Priority Flat Rate.

And the same issue (no starting box weight) is also present in the UPS module.

It may not seem like a big deal to some, but those $2- $5 differences (which are out of our pocket) add up after awhile and can cause a significant loss of profit/income.

Link to comment
Share on other sites

  • 6 months later...
Guest Klutzys

I just posted this in another thread, but wanted to make sure to maintain continuity where possible.

Variable rates are available once we eliminate the <container> tag from the rate request. This means that the code will have to be edited to make that a conditional thing, sent only when using Flat Rate, but not sent when using Variable Rates.

I've tested the following, and IT WORKS!!

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.

Well this is the 2nd I fix I have tried on CC v3.0.17 and this doesn't work either (1st one was for category order). What gives? Here is what my file now says:

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

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

}

$this->request_xml .= '<Size>' . ucfirst(strtolower($attribs['size'])) . '</Size>';

Please HELP I am getting frustrated, it's not hard to copy/paste so I can't figure out why these aren't working for me.

These are the errors I get in my cart now:

Request XML:<RateV3Request USERID="XXXX" PASSWORD="XXXX"><Package ID="0"><Service>PRIORITY</Service><ZipOrigination>64454</ZipOrigination><ZipDestination>62010</ZipDestination><Pounds>0</Pounds><Ounces>8</Ounces><Container>RECTANGULAR</Container><Size>Regular</Size></Package></RateV3Request>Return XML:<?xml version="1.0"?>

<RateV3Response><Package ID="0"><Error><Number>-2147219431</Number><Source>DomesticRatesV3:clsRateV3ValidateContainer;RateEngineV3.ProcessRequest</Source><Description>Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope and Flat Rate Box.</Description><HelpFile></HelpFile><HelpContext>1000440</HelpContext></Error></Package></RateV3Response>

Request XML:<RateV3Request USERID="XXXX" PASSWORD="XXXX"></RateV3Request>Return XML:<?xml version="1.0"?>

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

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

Tammy

Link to comment
Share on other sites

Hi Tammy,

USPS changed their web interface since I created and posted this fix. As I no longer use standard Priority (because I can't have that AND flat-rate) I haven't reapplied the fix to the new USPS module. I guess what I'm saying is that the new module may need a further refinement to this fix in order to work.

While I would love to help you track down the necessary changes to the updated USPS module, I'm swamped with other tasks right now. Hopefully someone else can take a look and see what needs to be done.

Link to comment
Share on other sites

  • 1 month later...
Guest nomadthreads

Hi Tammy,

USPS changed their web interface since I created and posted this fix. As I no longer use standard Priority (because I can't have that AND flat-rate) I haven't reapplied the fix to the new USPS module. I guess what I'm saying is that the new module may need a further refinement to this fix in order to work.

While I would love to help you track down the necessary changes to the updated USPS module, I'm swamped with other tasks right now. Hopefully someone else can take a look and see what needs to be done.

thank you! this works great.

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