Let’s try overriding Mage_Checkout_Helper_Cart helper class in this article.
Step 1 – Create a module in your local folder app/local/Magemonkeys/Checkout
Step 2 – Register your module in etc/modules directory by creating Magemonkeys_Checkout.xml file with the following content:
1 2 3 4 5 6 7 8 9 |
<?xml version="1.0"?> <config> <modules> <Magemonkeys_Checkout> <active>true</active> <codePool>local</codePool> </Magemonkeys_Checkout> </modules> </config> |
Step 3 – Create a config.xml file inside your etc directory of your module directory app/local/Magemonkeys/Checkout/etc/config.xml with the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?xml version="1.0"?> <config> <modules> <Magemonkeys_Checkout> <version>0.0.1</version> </Magemonkeys_Checkout> </modules> <global> <helpers> <checkout> <rewrite> <data>Magemonkeys_Checkout_Helper_Data</data> </rewrite> </checkout> </helpers> </global> </config> |
Step 4 – Create Data.php file in helper directory of your module directory app/local/Magemonkeys/Checkout/helper/Data.php with the following code snippet:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php class Magemonkeys_Checkout_Helper_Data extends Mage_Checkout_Helper_Data { public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'onepage') { return false; } public function newCheckoutHelperFunction() { return 'Overridden checkout helper function' } } ?> |
Step 5 – You can call your new helper function in phtml file by using the following code:
1 2 3 |
<?php echo $this->helper('checkout')->newCheckoutHelperFunction(); ?> |
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62877029ae658669867911/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...