edcorusa wrote:This is great. I do have one problem. I wish to ship all domestic orders though FedEx and only international orders using USPS. When I uncheck all of the domestic shipping and save it recheck 3 of them. Is there a way not to have the domestic shipping options come up?
Admittedly, I didn't consider the scenario where all the domestic or all the international rates would want to be omitted for USPS. The problem doesn't exist for the similar FedEx and UPS modifications, but it exists for USPS because the carrier services had to be split due to domestic and international services using some of the same service IDs (the modifications filter the response by services IDs since service names can change).
Each of the selectable rates modifications I posted (UPS, FedEx, and USPS) select default services to offer, if none are selected, when their configuration is saved. If the default services feature was disabled in the code (a reasonable option), then selecting none of the services options would perform no filtering and all the services would be returned (1.80 & earlier standard practice). Since, if you wanted none of the services, you would disable the shipping rate computation method. It also may seem counter intuitive to disable the filtering if no services are selected to offer to customers (i.e. return all rates), but it was implemented this way so that store owners could upgrade (if the modification was included in nopCommerce) and not have their (FedEx, UPS, or USPS) shipping rates stop working due to a needed configuration update (that they may not be aware was needed).
A
workaround to disable all of the domestic services for USPS would be select a service that wouldn't be returned from USPS (based on the request), thus preventing the selection of the default services on save. "First Class" could be checked for USPS domestic since it has a max weight of 13 ozs and nopCommerce submits at a minimum 1 lb.
A
fix would be to add a "NONE" (name and key) entry to the domestic and international checkbox lists so that by selecting it would cause the other options to not be saved. It would still perform the filtering, but since it wouldn't match any response service IDs, none of the services would be displayed. There is potential problem if a store owner selects both "NONE" options, in that it would effectively disable the USPS shipping service.
Initial post updated with the fix applied to the modification..