4
votes

The cart_shipping.list method in the Magento Core API does not return all shipping/payment methods enabled on the admin site. The enabled methods are Flat Rate, Table Rates, Free Shipping, UPS, USPS, FedEx and DHL. Calling cart_shipping.list only returns Flat Rate, Free Shipping and UPS.

Any ideas as to why?

My main suspicion (when looking at the getShippingRatesCollection() function of the Mage_Sales_Model_Quote_Address class) is that the shipping address set for the order is used to filter some of the methods out. However, I don't fully understand how this filtering occurs, since in the front end this problem does not occur when using the same shipping address (i.e. I can see all the shipping methods that I expect to see for that address).

1
Are you sure you don't have any condition like "this payment/shipping method available if cart total > $100"? Check your payment/shipping methods settings in admin. Also it is possible that some methods are disabled on website/store level.Dmytro Zavalkin
@Zyava In the admin site, I only selected "Yes" in the enabled field of each method. You may be right about the conditional availability of some methods, but I am not sure how one can set those conditions in admin.Epicurus
I'm currently running into the same problem as you, Epicurus. With the Table Rates shipping method and Magento Enterprise version 1.11.2.0. Three carriers that do work are: flatrate, freeshipping and storepickup. Epicurus, can you tell us what "subset" of methods is being returned for you and which ones you don't see even though you enabled them. This information is not yet in your question. Also, make sure to check the front-end: do a checkout with the product(s) you're passing to the API to see if the methods are really enabled there.Norbert
@Norbert: Could the problem in your case be related to the configuration of the Table Rates shipping method (magentocommerce.com/knowledge-base/entry/…)?Epicurus

1 Answers

5
votes

I have found a working solution to this issue, at least in my case.

The problem was that I was not specifying a Store Id in any of the methods used to create a cart and specify its products and delivery/billing addresses leading up to the call to cart_shipping.list.

These methods are: cart.create, cart_customer.set, cart_customer.addresses and cart_product.add. They all take a Store Id as an optional parameter. Specifying this store ID leads to all shipping methods visible in the front end for the same product and delivery address being displayed.