Magento Flat Rate Shipping only if chart is over a certain amount

Magento Flat Rate Shipping only if chart is over a certain amount

October 5, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Flat Rate Shipping only if chart is over a certain amount

Enabling Magento Flat Rate Shipping for Subtotals Over a Certain Amount

In Magento 1.7, you can configure your store to use flat rate shipping only if the cart subtotal exceeds a specified amount. This allows you to offer discounted or fixed-rate shipping for larger orders while still using standard rates for smaller purchases.

Understanding the Default Configuration

By default, Magento provides two main shipping methods: Free Shipping and Flat Rate.

  • Free Shipping: Applies when your customer’s order meets certain conditions (like minimum subtotal).
  • Flat Rate: Provides a fixed rate regardless of the number of items or their weight.

However, out-of-the-box, you can only set up free shipping based on subtotal. To achieve flat rate shipping for specific subtotals, we’ll need to create a custom extension.

Creating a Custom Extension

To add this functionality, follow these steps:

  1. Create the necessary files: In your Magento root folder, navigate to app/code/local/Your_Module/. If the directory doesn’t exist, create it using mkdir -p app/code/local/Your_Module/.

  2. Configure the XML

    Create a new file called config.xml in the etc subdirectory of your module:

    <!-- config.xml -->
    <config>
        <modules>
            <Your_Module_SubtotalFlatRate>
                <active>true</active>
                <codePool>local</codePool>
                <depends>
                    <Mage_Core />
                </depends>
            </Your_Module_SubtotalFlatRate>
        </modules>
    
        <global>
            <models>
                <your_module>
                    <class>Your_Module_Model</class>
                    <resourceModel>your_module_resource</resourceModel>
                </your_module>
                <your_module_resource>
                    <class>Your_Module_Model_Mysql4</class>
                    <entities>
                        <flat_rate>
                            <table>shipping_flat_rate</table>
                        </flat_rate>
                    </entities>
                </your_module_resource>
            </models>
    
            <resources>
                <your_module_setup>
                    <setup>
                        <module>Your_Module</module>
                        <version>1.0.0</version>
                    </setup>
                </your_module_setup>
            </resources>
        </global>
    </config>
    
  3. Create the model

    In app/code/local/Your_Module/Model/, create a new file called FlatRate.php:

    <?php
    class Your_Module_Model_FlatRate extends Mage_Core_Model_Abstract
    {
        protected function _construct()
        {
            $this->_init('your_module/flat_rate');
        }
    }
    
  4. Override the shipping method

    Open app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php and add your custom logic in the collectRates method:

    <?php
    class Mage_Shipping_Model_Carrier_Flatrate extends Mage_Shipping_Model_Carrier_Abstract
    {
        // ... existing code ...
    
        public function collectRates(Mage_Shipping_Model_Rate_Request $request)
        {
            $subtotal = $this->getQuote()->getSubtotal();
            if ($subtotal > $your_custom_amount) { 
                return parent::collectRates($request);
            } else {
                // Return an empty rate request for smaller orders
                return [];
            }
        }
    
        // ... existing code ...
    }
    

Replace $your_custom_amount with the desired minimum subtotal.

Conclusion

With these modifications, your Magento store will now offer flat rate shipping automatically whenever a customer’s cart subtotal exceeds the specified amount. This allows you to provide discounted or fixed-rate shipping for larger orders while still using standard rates for smaller purchases.

Remember to clear your cache and refresh your storefront after making changes:

php shell/indexer.php reindexall

For more advanced customizations and best practices in Magento development, check out the dedicated resources at Laravel Company’s Magento Development Guide.

Magento 1 Checkout Extensions Themes

Our network