Search code examples
magento

get shipping price outside Magento


I'm trying to create an order outside Magento, my current problem is that I need to know the shipping tablerate cost before creating the order in Magento.

Any suggestions?


Solution

  • There are 2 options:

    1. Table rates are stored in shipping_tablerate table. So knowing your calculation type (Magento table rates have 3 calculation variants) and order conditions (weight, price, destination, # of items) query database directly.

    2. You can create a quote object, add quote items and addresses and then run Mage_Shipping_Model_Shipping::collectRatesByAddress.