0

In my project at admin panel I have set Store->Configuration->Sales->Payment Method->Ccavenuepay and Minimum Order Total to 1 or 0.1.

On checkout page when I apply the discount coupon, my grand total becomes zero. In that case, it should show message No Payment Information Required as per set in admin panel. but it shows No payment methods available message. And when I refresh the page then it shows No Payment Information Required and then after a second shows all payment method which I am using. Can somebody please help me with this issue?

0

It could possibly be the same issue that I've had before where Free Shipping is calculated on the base subtotal with tax included before the discount is applied. I've made a little rewrite to fix that below. I hope the fix works for your issue too!

app/code/local/MyCompany/FreeShippingAfterDiscount/Model/Shipping/Carrier/Freeshipping.php

<?php

class MyCompany_FreeShippingAfterDiscount_Model_Shipping_Carrier_Freeshipping
    extends Mage_Shipping_Model_Carrier_Freeshipping
{

    /**
    * FreeShipping Rates Collector
    *
    * @param Mage_Shipping_Model_Rate_Request $request
    *
    * @return Mage_Shipping_Model_Rate_Result
    */
    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        if (!$this->getConfigFlag('active')) {
            return false;
        }

        $result = Mage::getModel('shipping/rate_result');

        $this->_updateFreeMethodQuote($request);

        #Custom line
        $valueAfterDiscount = ($request->getBaseSubtotalInclTax() - $request->getPackageValue()) + $request->getPackageValueWithDiscount();

        if (($request->getFreeShipping())
            || ($valueAfterDiscount >=
                $this->getConfigData('free_shipping_subtotal'))
        ) {
            $method = Mage::getModel('shipping/rate_result_method');

            $method->setCarrier('freeshipping');
            $method->setCarrierTitle($this->getConfigData('title'));

            $method->setMethod('freeshipping');
            $method->setMethodTitle($this->getConfigData('name'));

            $method->setPrice('0.00');
            $method->setCost('0.00');

            $result->append($method);
        }
        return $result;
    }
}

app/code/local/MyCompany/FreeShippingAfterDiscount/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyCompany_FreeShippingAfterDiscount>
            <version>1.0.0</version>
        </MyCompany_FreeShippingAfterDiscount>
    </modules>
    <global>
        <models>
            <freeshippingafterdiscount>
                <class>MyCompany_FreeShippingAfterDiscount_Model</class>
            </freeshippingafterdiscount>
            <shipping>
                <rewrite>
                    <carrier_freeshipping>MyCompany_FreeShippingAfterDiscount_Model_Shipping_Carrier_Freeshipping</carrier_freeshipping>
                </rewrite>
            </shipping>
        </models>
    </global>
</config> 

app/etc/modules/MyCompany_FreeShippingAfterDiscount.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyCompany_FreeShippingAfterDiscount>
            <active>true</active>
            <codePool>local</codePool>
        </MyCompany_FreeShippingAfterDiscount>
    </modules>
</config>

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.