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(); ?> |
[crayon-63d3df13d18ad418513955/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.