Magento Core API: listing all shipping methods

The cart_shipping.list method in the Magento Core API does not return all shipping / payment methods installed on the administratorโ€™s site. The methods included are bid, rates, free shipping, UPS, USPS, FedEx and DHL. Calling cart_shipping.list returns only Flat Rate, Free Shipping and UPS.

Any ideas on why?

My main suspicion (when viewing the getShippingRatesCollection() function of the getShippingRatesCollection() class) is that the delivery address specified for the order is used to filter some of the methods. However, I do not quite understand how this filtering occurs, since in this case this problem does not occur when using the same delivery address (i.e. I can see all the delivery methods that I expect to see for this address) .

+4
source share
1 answer

I found a working solution for this problem, at least in my case.

The problem was that I did not specify the store identifier in any of the methods used to create the basket, and indicated its products and delivery / billing addresses leading to the call to cart_shipping.list .

These methods are cart.create , cart_customer.set , cart_customer.addresses and cart_product.add . All of them take the store identifier as an optional parameter. Specifying this store identifier leads to all delivery methods visible in the interface to display the same product and delivery address.

+5
source

Source: https://habr.com/ru/post/1402233/


All Articles