ShipRateQuoteDataSource.QuoteForShipment() returns nothing

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
freeweaver
Ensign (ENS)
Ensign (ENS)
Posts: 8
Joined: Mon Apr 18, 2011 11:46 am

ShipRateQuoteDataSource.QuoteForShipment() returns nothing

Post by freeweaver » Sat May 26, 2012 3:21 pm

I'm trying to test shipping methods in my site, and I'm not getting anything back from USPS.

I've set up several shipping methods - 2 custom methods, and 4 from USPS - Priority Mail, Express Mail, Priority Mail International, and Express Mail International

This is my code snippet.

Code: Select all

ICollection<ShipRateQuote> rateQuotes = ShipRateQuoteDataSource.QuoteForShipment(shipment.ApplicableShipMethods);
            foreach (ShipRateQuote quote in rateQuotes)
            {
                if (quote.ShipMethodId == shipment.ShipMethodId)
                {
                    if (quote.Warnings == null)
                        quote.Warnings = new List<string>();
                    quote.Warnings.Add("selected");
                }
            }
            ShipMethodGrid.DataSource = rateQuotes;
            ShipMethodGrid.DataBind();
            if (rateQuotes.Count == 0)
            {
                ContinueButton.Visible = false;
            }
            else
            {
                // IN CASE WE HAVE DISABLED THE CONTINUE BUTTON BEFORE
                ContinueButton.Visible = true;
            }
        }
The shipment object is a BasketShipment object. It includes an ApplicableShipMethods property, which includes all the shipmethods it should. For instance, I have a test order with Afghanistan as the country. The USPS international methods are in that list. However, the ShipRateQuote collection doesn't include any USPS quotes at all.
I'm ordering an item whose weight is 0.5lbs, and I've tried changing the quantity, ranging from 1 to 15, with no difference.
Anything obvious to anybody?

Post Reply