I have the following code and I have searched and searched and can not find the answer. Everything I find on these forums tell me to do what I have already done but the shipping cost will just not save on the quote.

Here is how I call the quote,

$quote = Mage::getModel('sales/quote')->load($QID);

I then add all my items and customer details etc and then I add the shipping details like so,

$delCost = 10 //// I set this as a variable 
$delTitle = 'MY CUSTOM TITLE' //// I set this as a variable 

    $quote->getShippingAddress()->setShippingDescription($delTitle); /// THIS IS WORKING

When I retrieve the quote I can see it has saved the shipping description but it doesn't save the cost .

This is stand alone code that I am using where I create a quote programmatically for a point of sale system I am creating. Any help would be most appreciated as I have followed every tutorial I can find and I know its probably something simple I am missing.

2 Answers 2


It may be that you have to add the shipping method as well. I've used the following code for free shipping before which works. You may need to add in your extra bits.

  • Just giving it a try think you may be right Nov 24, 2016 at 22:01
  • if i want to set custom shipping price how? using the same syntax Jul 16, 2020 at 8:53

You can add shipping cost to the quote programmatically by creating a new module for shipping follow below reference link.


edit a function mentioned in the above link:


$delCost = 10
$rate = Mage::getModel('shipping/rate_result_method'); 
$rate->setMethodTitle('Standard delivery');

return $rate;

And set your price in the setPrice(your price ) and setCost functions

Also set this new shipping method on the quote.


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.