0

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!

1

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.

0

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

app\code\core\Mage\Shipping\Model\Carrier\Flatrate.php
and add the code below.

Find code::

$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);

And replace with::

if(Mage::registry('shipping_cost'))
{
 $method->setPrice(Mage::registry('shipping_cost'));
 $method->setCost(Mage::registry('shipping_cost'));
} else {
 $method->setPrice('0.00');
 $method->setCost('0.00');
}

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 :)
0

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, privacy policy and cookie policy

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