Shipping Method addition is happening as it should be. But, Shipping Rate as per the Shipping method or, custom Shipping rate is not getting added to the order.

$address = $quoteObj->getShippingAddress ();
$address->setCollectShippingRates ( true )->collectShippingRates()
$quoteObj->collectTotals ()->save ();

Searching through some other questions I found a solution which adds Custom Shipping Rate to the order, but it doesn't add the shipping rates to Grand Total.

$shippingprice = 0.9;

enter image description here

3 Answers 3


Try this:

$shippingprice = 0.9;
$orderObj->setGrandTotal($orderObj->getGrandTotal() + $shippingprice); //adding shipping price to grand total
  • Thanks for your reply. But it's not working, throwing fault. Mar 4, 2015 at 6:09
  • may i know what is the fault it's throwing?
    – MagExt
    Mar 4, 2015 at 20:28

did you get this solved?

For anyone running into this, you need to set the shipping costs in 2 places. First of all you need to set the shipping method and WITHIN the shipping method you need to set your price. I made my own setShippingMethod function like below:

public function setMyShippingMethod($shippingPrice = 0)
$result = Mage::getModel('shipping/rate_result');
// Add carrier
$method = Mage::getModel('shipping/rate_result_method');
if ($shippingPrice > 0) {
   // use my custom shipping method but you can use another shipment method here
   $method->setMethodTitle('outside the Netherlands'); 
} else {
   $method->setMethodTitle('within the Netherlands');
    return $result;

Then within my createOrder function I add the shippingAddress and then call my method like this:

$shippingMethod = $this->setMyShippingMethod($shippingCost);
$this->_order->setShippingDescription('My shipping description');

Then of course I still need to add the costs to the order as mentioned:


I hope it helps anybody.

  • 1
    $this->order is your quote or your actual order object?
    – Eduardo
    Mar 2, 2017 at 16:27

Try this


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.