I want to create custom shipping rate according to a formula which is Shipping rate = product weight + 10.00$ and add it to total grand total programmatically. I wanted to know the procedure for creating it. Thanks in advance!


3 Answers 3


You can create multiple shipping methods with different shipping price by using free Magento plugin i.e.MatrixRate of webshopapps.

You can download plugin from here : https://webshopapps.com/row/matrixrate-shipping-extension.html?___store=row

Video link for how to set up Matrix Rates shipping: https://www.youtube.com/watch?time_continue=90&v=u6MjF4oya3Y

This Magento extension is worked for me.


How to add custom shipping price when create order programatically in Magento

Step 1: Add below code in custom order create function.

$shippingPrice = 20;
Mage::register('shipping_cost', $shippingPrice);

Step 2: Now open file

and add the code below.

Find code::


And replace with::

} else {

Step 3: Done. Clear the cache.

Note: Override the file app\code\core\Mage\Shipping\Model\Carrier\Flatrate.php in local like : app\code\local\Mage\Shipping\Model\Carrier\Flatrate.php ... as you know :)

Install Owebia shipping extension which is available free of cost.. here and marketplace ( Don't worry about quality code as it's on marketplace)

owebia extension for magento 1

   "id_012": {
      "label": "Shipping",
      "fees": "{product.attribute.weight-tax+discount} + 10.00"

worked for any formulas and conditions..

check documentation for rule here..

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.