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


Try this:

$shippingprice = 0.9;
$orderObj->setGrandTotal($orderObj->getGrandTotal() + $shippingprice); //adding shipping price to grand total
| improve this answer | |
  • Thanks for your reply. But it's not working, throwing fault. – Rahul Kumar Das Mar 4 '15 at 6:09
  • may i know what is the fault it's throwing? – MagExt Mar 4 '15 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.

| improve this answer | |
  • $this->order is your quote or your actual order object? – Eduardo Mar 2 '17 at 16:27

Try this

| improve this answer | |

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.