2

Is it possible to retrieve all shipping carrier/rates starting from an Order instead of using a quote ?

UPDATE

With the following code I'm converting the order to a quote and the address. There is still some issue: Mage_Sales_Model_Quote_Address::requestShippingRates() is returning false (this is called by collectTotals())

$converter = mage::getModel('sales/convert_order');
$quote = $converter->toQuote($this->getOrder());
$quoteAddress = $converter->toQuoteShippingAddress($this->getOrder());

foreach ($this->getOrder()->getAllItems() as $item) {
//            $itemW = $item->getWeight();
//            $itemQty = $item->getWeight();
//            $itemTotalWeight = $itemW * $itemQty;

                $quoteItem = $converter->itemToQuoteItem($item);
                $quoteItem->setQuote($quote);
                $quoteItem->setQty($item->getQtyOrdered());
                $quoteItem->setWeight($item->getWeight());
                $quote->addItem($quoteItem);

                $quoteAddress->addItem($quoteItem);
            }
$quoteAddress->setQuote($quote);
$quoteAddress->setCollectShippingRates(true);
$quoteAddress->collectTotals();
  • ever find out what was going on here? – David Manners Mar 27 '15 at 8:12
2

I read your question wrong. I think this is not possible, but you should get the quote from the order via $order->getQuoteId()

OLD

what about:

Mage::getResourceModel('sales/shipment_collection')
    ->addAttributeToFilter('order_id', $order->getId());

and then just sum the costs up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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