3

I have set a Flat rate shipping of R100.00 (South African Rands) for all items less than R500.00. At the moment it is working. It loads if the orders are less than R500.

However the moment the order us greater than R500, I still get the Flat rate instead of just the Free shipping. How would I go about hiding the flat rate for items over R500 in Magento?

I am using Magento 1.9.0.1. Let me know if you require any clarification.

1

Unfortunately I did not find an event that you can use.
But you can override the method Mage_Shipping_Model_Carrier_Flatrate::proccessAdditionalValidation and check if the subtotal is below 500.
You will need to create a new module. Let's call it Easylife_Shipping.
app/etc/modules/Easylife_Shipping.xml - the declaration file

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Shipping>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Shipping />
            </depends>
        </Easylife_Shipping>
    </modules>
</config>

app/code/local/Easylife/Shipping/etc/config.xml - the configuration file

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Shipping>
            <version>1.0.0</version>
        </Easylife_Shipping>
    </modules>
    <global>
        <models>
            <shipping>
                <rewrite>
                     <carrier_flatrate>Easylife_Shipping_Model_Carrier_Flatrate</carrier_flatrate>
                </rewrite>
            </shipping>
        </models>
    </global>
</config>

app/code/local/Easylife/Shipping/Model/Carrier/Flatrate.php - your new model class

<?php 
class Easylife_Shipping_Model_Carrier_Flatrate extends Mage_Shipping_Model_Carrier_Flatrate implements Mage_Shipping_Model_Carrier_Interface {
    public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) {
        if ($request->getSubtotal() > 500) {
             return false;
        }
        return parent::proccessAdditionalValidation($request);
    }
}

of course a better idea would be not to hard code 500. You can put it in a config setting and read it from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy