USPS priority mail shipping displays "Please enter the package weight" in the "Calculate shipping cost" area. It does display a shipping charge. But that shipping charge is different from the actual correct charge at the post office.

I also get the following log error message:

Location https://mysite.com/system/ajax
Referrer https://mysite.com/checkout
Message Notice: Undefined property: stdClass::$weight in _uc_usps_package_products() (line 681 of /home/mysite/public_html/sites/default/modules/ubercart/shipping/uc_usps/uc_usps.module).

Comments

TR’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Have you entered weights for all your products?

gscerb’s picture

All products have the weight entered.

If there is only one product I don't get the prompt to enter the package weight.
If there are two different products I get a message as below:

Please enter the package weight.
U.S.P.S. Priority Mail 1-Day™ (2 packages): $USD 5.99

mfb’s picture

Status: Postponed (maintainer needs more info) » Active

I am also seeing this when more than one product is in cart; all products do have defined weights.

The XML error messages look like this:

API=RateV4&XML=<RateV4Request USERID=""><Revision>2</Revision><Package ID="0"><Service>ALL</Service><ZipOrigination>94109</ZipOrigination><ZipDestination>94607</ZipDestination><Pounds>0</Pounds><Ounces>0.0</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Width>0</Width><Length>0</Length><Height>0</Height><Girth>0</Girth><Value>0</Value><Machinable>FALSE</Machinable><ReturnLocations>TRUE</ReturnLocations><ShipDate Option="EMSH">12-Sep-2013</ShipDate></Package></RateV4Request>

<?xml version="1.0"?>
<RateV4Response><Package ID="0"><Error><Number>-2147219500</Number><Source>DomesticRatesV4;clsRateV4.ValidateWeight;RateEngineV4.ProcessRequest</Source><Description>Please enter the package weight.  </Description><HelpFile></HelpFile><HelpContext>1000440</HelpContext></Error></Package></RateV4Response>
mfb’s picture

OK I was able to resolve this by setting the "DEFAULT PRODUCT PICKUP ADDRESS" for each product to the correct address. We moved recently, so half of the products had the old address and half had the new address.

This seems like a bug - the pickup address for an individual product should not be saved unless it's actually different from the site-wide default product pickup address.

Things may still be broken for sites that intentionally use different product pickup addresses.

TR’s picture

Category: support » feature

Just what I was about to ask you! Examining the code, it looks like the only way the package weight could not be set is if the default pickup address is not set.

Yes, it's probably a good idea to make uc_quote_get_default_shipping_address() return the store address as a default. I think there may be another issue open for that - I'll look into it.

TR’s picture

Title: USPS - Please enter the package weight. » Default shipping address should default to store address.

New title to better reflect the issue.

mfb’s picture

Hmm, as far as I can tell we did have a site-wide "default pickup address" set as well as a "default product pickup address" for each product.. The problem went away when I set all of these to the same address.

TR’s picture

Did you upgrade your site from D6 Ubercart? Or from a version of D7 Ubercart more than 2 years old?

mfb’s picture

According to the site's git repo, ubercart module was added on Mon Nov 21 17:08:38 2011 -0800

The initial version had

; Information added by drupal.org packaging script on 2011-10-07
version = "7.x-3.0-rc2"
TR’s picture

There was a change back then where the default address was changed to be stored as an object instead of an array. That might be the problem, which would be fixed by re-saving the default shipping address by going to admin/store/settings/quotes/settings and pressing "Save configuration". Can you do that, then try to change one of your products to use a different address and see if you still have the problem?

mfb’s picture

Ok, it looks like I no longer get that error with different product pickup addresses, after re-saving the site-wide pickup address. Perhaps this would fix gscerb's problem too?

moshiuramit’s picture

Component: Shipping » Code
Issue summary: View changes

May be its not relevant, and yet I intended to know. Is there any option on Ubercart Address module to set or auto fill the shipping address from the default address of the user. If so is there anyone can describe how can I achieve it. Thanks in advance.

TR’s picture

Component: Code » Shipping quotes

@moshiuramit: That has nothing to do with this issue - this issue is about the default ship FROM address assigned to products. This has nothing to do with customer addresses. And if you have a question about the Ubercart Address module, ask in the issue queue for that module.