I assume from your reply that you are using RTShipping and that UPS is returning ground options for shipping to those states.
If that is the case, you can modify the appropriate checkout file. We are doing this for a customer who has certain types of products that can ONLY be shipped to the continental US (no Alaska or Hawaii) and it can only go UPS Ground. We identify the orders that have this class of product and will remove all shipping options except Ground from those returned by the RTShipping function.
You could do the same, only removing Ground as an option if the shipping state is HI or AK.
The file you choose to edit will be determined by whether you are using one-page checkout or not. If yes, then edit checkout1.aspx.cs; if no, edit checkoutshipping.aspx (perhaps checkoutshippingmult and mult2 if need be).
In place of the following call
C#/VB.NET Code:
ShippingOptions.Text = ShipMethods;
You'll want to check and see if
C#/VB.NET Code:
if (ThisCustomer.PrimaryShippingAddress.Country != "United States"
|| ThisCustomer.PrimaryShippingAddress.State == "AK" // Alaska
|| ThisCustomer.PrimaryShippingAddress.State == "AS" // American Samoa
|| ThisCustomer.PrimaryShippingAddress.State == "AA" // Armed Forces, Asia
|| ThisCustomer.PrimaryShippingAddress.State == "AE" // Armed Forces, Europe
|| ThisCustomer.PrimaryShippingAddress.State == "AP" // Armed Forces, Pacific
|| ThisCustomer.PrimaryShippingAddress.State == "FM" // Federated States of Micronesia
|| ThisCustomer.PrimaryShippingAddress.State == "GU" // Guam
|| ThisCustomer.PrimaryShippingAddress.State == "HI" // Hawaii
|| ThisCustomer.PrimaryShippingAddress.State == "MH" // Marshal Islands
|| ThisCustomer.PrimaryShippingAddress.State == "MP" // Northern Mariana Islands
|| ThisCustomer.PrimaryShippingAddress.State == "PW" // Palau
|| ThisCustomer.PrimaryShippingAddress.State == "PR" // Puerto Rico
|| ThisCustomer.PrimaryShippingAddress.State == "VI" // Virgin Islands
)
And if so, loop through the shipmethods string and remove the option for Ground Shipping. You could do that by the following:
C#/VB.NET Code:
String[] sDelimiters = { "<br/>" };
String[] shippingMethods = ShipMethods.Split(sDelimiters, StringSplitOptions.RemoveEmptyEntries);
StringBuilder sbShipMethods = new StringBuilder();
foreach (string s in shippingMethods)
{
if (!s.Contains("UPS Ground"))
sbShipMethods.Append(s + "<br/>");
}
ShippingOptions.Text = sbShipMethods.ToString();
Since this is a modification/simplification of the code we used to the rather complicated shipping decisions we need to make for this one customer, I hope I didn't introduce any bugs into the code above. However, I'm sure it is complete enough to work for what you need to do.
Best of luck!
MJG