I'd love to have two "Estimate Shipping and Tax" blocks:

  1. One to display domestic rates to a default address. This one would have no form and would be displayed at all times.
  2. The other to estimate international shipping would be just the standard form + rates.

I've got the layout and template part of it working, but I don't seem to be able to customize the functionality of checkout/cart_shipping block. I was planning on adding a method (setAddress) to set the default address to be use for calculation.

However, going through the code, the cart_shipping, quote and it's shipping_address objects appear to be all wired through and I see no easy way to create two Estimate Shipping blocks for two different addresses.

Any suggestions much appreciated.

  • "To a default address" - do you mean the customer's default shipping address, or an example address like your store?
    – philwinkle
    Feb 14, 2013 at 4:48
  • I mean an admin-configured address not modifiable by frontend user (as opposed to the block #2). Default store address should do if it makes things easier.
    – Jan Tomka
    Feb 14, 2013 at 5:39
  • I don't think pulling an actual shipping quote would be necessary, then. Why not create a static block that mimics the look of the shipping quote box with your rates prepopulated? If the store address won't change very frequently, neither will the rates you're intending to display.
    – philwinkle
    Feb 14, 2013 at 15:03
  • Store address won't change, but shipping rates may, when you set up a couple of price rules (e.g. free shipping based on quote total). Anyway, I may end up doing just what you're suggesting, even though I was after something you can set and forget. Static block is not quite that.
    – Jan Tomka
    Feb 14, 2013 at 22:28

1 Answer 1


As you've noticed, there's extensive coupling among the custom, address, quote, and shipping objects which hampers what you are trying to accomplish. However, if you dig into the carrier, rate_request and rate_result models, the architecture is pretty simple. You only need to know which methods apply to your default address, and you may need to also know order total, weight, and/or number of packages. Then you can construct the rate_request object which Magento expects; see Mage_Shipping_Model_Shipping::collectRatesByAddress():

public function collectRatesByAddress(Varien_Object $address, $limitCarrier = null)
    /** @var $request Mage_Shipping_Model_Rate_Request */
    $request = Mage::getModel('shipping/rate_request');


    return $this->collectRates($request);

I think that you can just handle this with a custom block type, and note that there is a result cache which should be honored. Various factors for your instance can affect the complexity of this customization (currencies, multiple carriers, complex shipment pricing, etc).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.