I updated to the latest version in bazaar and when I go to checkout the shipping quotes just says
"Please enter the package weight"
I checked everything an nothing works... Strange
|
UbercartOne cart to rule them all... |
|
| Donate | Affiliates | Sponsors | ||
Please enter the package weight.
Submitted by alien73 on Mon, 01/28/2008 - 10:34
I updated to the latest version in bazaar and when I go to checkout the shipping quotes just says "Please enter the package weight" I checked everything an nothing works... Strange
I'm seeing the same issue on Drupal 5.7, Ubercart 1.0beta3... The weights are specified. I tried this with two products. One has attributes, and the other does not. The request to USPS seems to be going through. The response from their server is: <?xml version="1.0"?>So, aside from a 'metoo', I'm also looking for a solution. I'll do a little more digging, but hope someone has an easy fix. I have it working without a problem on beta 2, so if there's a bug it's something that was introduced recently. Do you by chance have your store default weight set to something other than pounds? Can you print the request XML as well as the response (remove your user ID from the request before posting!). It sure sounds like the weight isn't being sent (maybe an error in unit conversion...), or that part of the XML is formatted improperly. I have it working without a problem on beta 2, so if there's a bug it's something that was introduced recently. Do you by chance have your store default weight set to something other than pounds? Can you print the request XML as well as the response (remove your user ID from the request before posting!). It sure sounds like the weight isn't being sent (maybe an error in unit conversion...), or that part of the XML is formatted improperly.
Mine is set to Pounds as default. I tried it with a product weight set in Pounds, and also with one in ounces. Same thing. What's the easiest way to capture the XML being sent from Ubercart? I looked, and couldn't find a setting to spit that out... Hmm, I could swear it just did it when you checked the debug box at admin/store/settings/quotes/edit, but trying it out it doesn't seem to show up. I don't know, it's late. Anyway, stick the following line in uc_usps.module in the function uc_usps_quote(), just after the first call to uc_usps_rate_request(): $services['data']['debug'] .= htmlentities($request) ."<br />\n";That should show your request. Hmm, I could swear it just did it when you checked the debug box at admin/store/settings/quotes/edit, but trying it out it doesn't seem to show up. I don't know, it's late. Anyway, stick the following line in uc_usps.module in the function uc_usps_quote(), just after the first call to uc_usps_rate_request():
$services['data']['debug'] .= htmlentities($request) ."<br />\n";That should show your request. Thanks, it did: API=RateV3&XML=%3CRateV3Request+USERID%3D%22(deleted)%22%3E%3CPackage+ID%3D%220%22%3E%3CService%3EALL%3C%2FService%3E%3CZipOrigination%3E95203%3C%2FZipOrigination%3E%3CZipDestination%3E92128%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E0.0%3C%2FOunces%3E%3CContainer%3ERECTANGULAR%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CMachinable%3EFalse%3C%2FMachinable%3E%3C%2FPackage%3E%3C%2FRateV3Request%3EAs you suspected, it looks like 0.0 oz and 0 Pounds. Bummer. That's actually good news - it narrows down the problem considerably. Either the weights aren't set for the products or the weight calculation in uc_usps got screwed up. I suspect the latter, since you said you checked your product weights and because a lot of work has been done on the _uc_usps_package_product() function recently. Maybe Lyle can quickly spot the problem. A quick way I use to see if the order weights are set right is to set up the Weight Quote shipping method to charge $1/lb. for shipping - that way on the checkout page when you get shipping quotes the shipping charge for Weight Quote will be = the shipping weight of your order. (Change this to $1/ounce if you want a more precise weight measure.) If Weight Quote gives the right answer then the problem is definitely in the uc_usps module. That's actually good news - it narrows down the problem considerably. Either the weights aren't set for the products or the weight calculation in uc_usps got screwed up. I suspect the latter, since you said you checked your product weights and because a lot of work has been done on the _uc_usps_package_product() function recently. Maybe Lyle can quickly spot the problem.
A quick way I use to see if the order weights are set right is to set up the Weight Quote shipping method to charge $1/lb. for shipping - that way on the checkout page when you get shipping quotes the shipping charge for Weight Quote will be = the shipping weight of your order. (Change this to $1/ounce if you want a more precise weight measure.) If Weight Quote gives the right answer then the problem is definitely in the uc_usps module. I enabled the Weight Quote module, set $1/lb, disabled USPS (Domestic and International) in the Shipping Quote configuration, and am seeing the same issue. To be complete, I removed the product from my shopping cart, and re-added it, checked again. No dice. Removed it again, set the product's weight up in lbs so that it would be the same across the board, re-added, and am still seeing the same issue. So Weight Quote is telling you $0 = 0 lbs. shipping weight? Sounds like this isn't a shipping quotes problem then. Time to inspect your database to make sure the product weights are really in there ... strange problem! So Weight Quote is telling you $0 = 0 lbs. shipping weight? Sounds like this isn't a shipping quotes problem then. Time to inspect your database to make sure the product weights are really in there ... strange problem!
Alrighty... I disabled the "Cart Links" module, which I had enabled, assuming I might use it in the future. "There were problems getting a shipping quote. Please verify the delivery and product information and try again. This occurs without the XML error from USPS being spit out as it was before, even though the debug info is turned on. I looked in the uc_products table, and the weight is in there. Update - So, for some reason, I had to disable the Weight Quote module for the USPS code to start working, even though Weight Quote was disabled in the Store admin, and USPS was enabled. Now I'm seeing the XML error from USPS, but it is still not sending the weight correctly... Updated to Ubercart 1.0b4, same issue... I'm having the very same issue. I'm using the latest release (ubercart-5.x-1.0-beta3) and this is occurring when attempting to retrieve shipping quotes. Here is the exact code I'm getting. <?xml version="1.0"?>Decided to do a little more digging... If I turn off "all in one" in the USPS shipping configuration, it seems to work, but I'm getting this now: <?xml version="1.0"?>If you're getting the options to select the shipping quote (and it looks like you should be, despite the error in the first part), you can turn off the debug information in the shipping quotes settings. I just checked the USPS module, and I don't know why the "all in one" setting wouldn't get the weight properly. It ought to work fine in beta 4, I think. Right, I had the debug XML on because it was not functioning with 'all in one'. It looks like others are having this problem, though. Does anyone have the USPS module confirmed working with 'all in one' enabled? Alright. warning: array_search() [function.array-search]: Wrong datatype for first argument in /home/rofl/public_html/dev/sites/all/modules/ubercart/shipping/uc_usps/uc_usps.module on line 564. If I set to ship "all in one" I get a simple "Please enter the package weight" - however I have set the products weight to 1lbs and tested it being 10oz and I get the same thing. Also notable, when I select to ship "all in one" in shipping quote settings, I get this: What to do? Moving along. Removing has helped somewhat. In that I am now getting quoted a price, albeit expensive and not correct one. Yet under the price, it's still telling me to enter the package shipping weight. Oh noes. What's this? user warning: Unknown column 'required' in 'field list' query: INSERT IGNORE INTO uc_product_attributes (nid, aid, ordering, required, default_option) SELECT 4, aid, ordering, required, default_option FROM uc_class_attributes WHERE pcid = 'product' in /home/rofl/public_html/dev/includes/database.mysql.inc on line 172. I got this when adding a new product. I just installed beta 4 and unfortunately it looks like the weight of packages still isn't being calculated properly when you use "All in one". When I switch to separate packaging my quotes work fine; otherwise I get "please enter package weight" from USPS. (drupal 5.7 / workflow-ng 5.x-1.6, if it matters) Oh noes.
What's this? user warning: Unknown column 'required' in 'field list' query: INSERT IGNORE INTO uc_product_attributes (nid, aid, ordering, required, default_option) SELECT 4, aid, ordering, required, default_option FROM uc_class_attributes WHERE pcid = 'product' in /home/rofl/public_html/dev/includes/database.mysql.inc on line 172. I got this when adding a new product. I got this after installing a fresh beta3, and I added the field 'required' manually. It looks like the install code in that version did not create the table with this field. It does, however, look that the beta4 adds that update. 'required' is needed in uc_product_attributes, and uc_class_attributes from what I can tell. I found the problem with the "All in one" option for USPS. Lines 547 and 548 should have $package[0]->weight instead of $package->weight. This has been committed to the bazaar repository and will be in the next release. I found the problem with the "All in one" option for USPS. Lines 547 and 548 should have $package[0]->weight instead of $package->weight. This has been committed to the bazaar repository and will be in the next release.
I changed those two lines in the beta4 version I had installed, and it seems to fix the issue. Thanks a bunch. I found the problem with the "All in one" option for USPS. Lines 547 and 548 should have $package[0]->weight instead of $package->weight. This has been committed to the bazaar repository and will be in the next release.
I went to change those two lines, but I only saw where to change it on line 546 and 547. $packages[$key][0]->pounds = floor($package[0]->weight);I'm getting this when I go to review my order with what I have above. warning: array_search() [function.array-search]: Wrong datatype for first argument in /home/rofl/public_html/dev/sites/all/modules/ubercart/shipping/uc_usps/uc_usps.module on line 535.Oh noes.
What's this? user warning: Unknown column 'required' in 'field list' query: INSERT IGNORE INTO uc_product_attributes (nid, aid, ordering, required, default_option) SELECT 4, aid, ordering, required, default_option FROM uc_class_attributes WHERE pcid = 'product' in /home/rofl/public_html/dev/includes/database.mysql.inc on line 172. I got this when adding a new product. I got this after installing a fresh beta3, and I added the field 'required' manually. It looks like the install code in that version did not create the table with this field. It does, however, look that the beta4 adds that update. 'required' is needed in uc_product_attributes, and uc_class_attributes from what I can tell. I have beta4 installed and I'm still getting this. Any ideas? You ran update.php? That error was a known bug with clean install in beta 3, which was fixed in beta 4. You do need to run update.php for the fix to work, and you should *always* run update.php when you update any Drupal modules. You ran update.php? That error was a known bug with clean install in beta 3, which was fixed in beta 4. You do need to run update.php for the fix to work, and you should *always* run update.php when you update any Drupal modules. Yep, I sure did. I always do. :\ Hmm, looking at the fix that was made to uc_attribute, it looks like it didn't completely fix the problem in the narrow case where you did a clean install of beta 3 then upgraded to beta 4. If you had done an upgrade from beta 2 to beta 3, or clean install of beta 4 (or above), or upgraded from beta 2 directly to beta 4, etc., there would be no problem. I'm not even sure that it's worth it to patch the module anymore to address that case, since it will be fine for every other case. Anyway, to fix: (I tested this procedure on a beta 3 installation, and it eliminated the problem). Unfortunately, that destroys any product attributes you might have set up. If you want to preserve your attributes, INSTEAD of the procedure above, you can execute the following SQL on your DB: ALTER TABLE {uc_product_attributes} ADD COLUMN required tinyint(2) NOT NULL default 0 AFTER default_optionHmm, looking at the fix that was made to uc_attribute, it looks like it didn't completely fix the problem in the narrow case where you did a clean install of beta 3 then upgraded to beta 4. If you had done an upgrade from beta 2 to beta 3, or clean install of beta 4 (or above), or upgraded from beta 2 directly to beta 4, etc., there would be no problem. I'm not even sure that it's worth it to patch the module anymore to address that case, since it will be fine for every other case.
Anyway, to fix: (I tested this procedure on a beta 3 installation, and it eliminated the problem). Unfortunately, that destroys any product attributes you might have set up. If you want to preserve your attributes, INSTEAD of the procedure above, you can execute the following SQL on your DB: ALTER TABLE {uc_product_attributes} ADD COLUMN required tinyint(2) NOT NULL default 0 AFTER default_optionI went thru the steps and I'm still getting the error... Well then, I don't know what to suggest, other than do a clean install. The procedure above results in a clean install of uc_attribute, so that should have fixed your DB table. Look in your uc_attribute.install and see if it defines the function uc_attribute_update_7() at the bottom - if it doesn't, you don't have beta 4! Look in your DB at the uc_product_attributes table using phpMyAdmin - the above procedure will create that table with a column named 'required'. If it didn't, you don't have beta 4. I don't see how uc_attribute could have been re-installed without this column created, unless you don't have the beta 4 version of uc_attribute. Oh wow. I thought I had beta4 this whole time. I downloaded it and never installed it. lol So, that fixed the shipping quote problem, but I still get the checkout page loading over and over instead of going to the review before you submit page. I get these back: warning: array_search() [function.array-search]: Wrong datatype for first argument in /home/rofl/public_html/dev/sites/all/modules/ubercart/shipping/uc_usps/uc_usps.module on line 535.
|
|
Joined: 11/10/2007