1

I need a help. I want to modify Magento's Paypal Express Checkout module. I want to add some data with the default data sent to Paypal while checkout using Paypal. But I didnot understand where to add data? I searched and find that while I choose paypal to checkout, Paypal uses the following link to proceed to next step: http://test.com/paypal/express/start Now I lost. I think the url execute the StartAction of ExpressController of the Paypal Module.But when I want to add some code in the startAction method, the added code is not reflecting on the page. What should I do? Please help.

  • Can you show us your module code that is extending the paypal module so we can help? – DanCarlyon Aug 12 '16 at 12:52
  • I am not extending the Paypal Module, I am trying to modify the Paypal Module. – Subhajyoti De Aug 12 '16 at 12:55
  • You shouldn't be editing a core module directly as that is not upgrade safe, any changes to the paypal (or any core modules) should be in your own module that overrides/extends the core module. We would also still need to know what code you are trying to we can help you debug and answer your question – DanCarlyon Aug 12 '16 at 12:59
  • ok. But can you give me a reference example that can extend the core module of Magento? I dont have any experience of extending core magento module. – Subhajyoti De Aug 12 '16 at 13:15
  • Added as an answer although it's a top level overview on how to extend a module. – DanCarlyon Aug 12 '16 at 13:25
0

To extend a core module you need to create the following folder structure

app/etc/local/Namespace/Module

app/etc/local/Namespace/Module/etc

Within your Namespace/Module/etc folder you will need a config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <namespace_module>
        <version>0.0.1</version>
    </namespace_module>
    </modules>
</config>

Then also in app/etc/modules/ you will need a Namespace_Module.xml

<?xml version="1.0"?>
<config>
  <modules>
    <namespace_module>
      <active>true</active>
      <codepool>local</codepool>
    </namespace_module>
  </modules>
</config>

Then back in your app/etc/local/Namespace/Module folder you can create your helpers, models and controllers that will override and extend the core ones.

For example if you wanted to override/extend the customer account controller

You would create a controllers/Frontend/Customer/ folder

with an AccountController.php (you would also have to add this controller as a node to your config.xml)

<?php
    require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';

  class Namespace_Module_Frontend_Customer_AccountController
extends Mage_Customer_AccountController
{//here, you extended the core controller with ours

    public function indexAction()
    {
      parent::indexAction();
      //you can always use default functionality
    }
}

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.