We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    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:

    <?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:

    <?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:

    <?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:

    <?php
         echo $this->helper('checkout')->newCheckoutHelperFunction();
    ?>

     

    Fill the below form if you need any Magento relate help/advise/consulting.

    With Only Agency that provides a 24/7 emergency support.

      Get a Free Quote