Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
TR CreditAttribution: TR commentedHave you entered weights for all your products?
Comment #2
gscerb CreditAttribution: gscerb commentedAll 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
Comment #3
mfbI 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:
Comment #4
mfbOK 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.
Comment #5
TR CreditAttribution: TR commentedJust 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.
Comment #6
TR CreditAttribution: TR commentedNew title to better reflect the issue.
Comment #7
mfbHmm, 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.
Comment #8
TR CreditAttribution: TR commentedDid you upgrade your site from D6 Ubercart? Or from a version of D7 Ubercart more than 2 years old?
Comment #9
mfbAccording to the site's git repo, ubercart module was added on Mon Nov 21 17:08:38 2011 -0800
The initial version had
Comment #10
TR CreditAttribution: TR commentedThere 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?
Comment #11
mfbOk, 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?
Comment #12
moshiuramit CreditAttribution: moshiuramit as a volunteer commentedMay 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.
Comment #13
TR CreditAttribution: TR commented@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.