0

I changed some coupon code error message in core file.its working fine. but if i copy the file to local [below] path , its not working for me.

app/code/core/Mage/Checkout/controllers/CartController.php - working


app/code/local/Mage/Checkout/controllers/CartController.php - not working

what else changes i need to do to fix this issue

1

Sorry, but copying files to app/code/local in order to override original core fiels only works for blocks, models and helpers. It does not work for controllers.

To override a controller you will have to create a module with the following in the config.xml:

<frontend>
    <routers>           
            <checkout>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Checkout">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </checkout> 
        </routers>
</frontend>

Then you'll have to create the following controllers/CartController.php file:

<?php

require_once 'Mage/Checkout/controllers/CartController.php'

class Vendor_Module_CartController extends Mage_Checkout_CartController
{
    // Add your custom code here
}
7
  • if it takes less time, can you please update the answer with complete steps of what and all needs to be done for this. – Baby in Magento Jul 14 '16 at 10:28
  • @BabyinMagento done – Raphael at Digital Pianism Jul 14 '16 at 10:31
  • Its really disadvanatge for small devolopers for again creating module. i hope magento team will fix this soon in new versions, thanks a lot. – Baby in Magento Jul 14 '16 at 11:13
  • @BabyinMagento I highly doubt Magento team will apply such modifications to Magento 1 as Magento 2 is the priority now – Raphael at Digital Pianism Jul 14 '16 at 11:14
  • thats true, is same logic in magento2 also regarding controllers ? – Baby in Magento Jul 14 '16 at 11:15

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.