Question

I have created a custom module in magento 1.9.2.2 and now I want to move the custom module in magento 2. I read few articles and also the magento2 custom module creation but i am getting confused from where to start. Since the syntax of magento2 is different from magento 1.9.2.2 Controller Action functions are separate in magento2 so do i have to create separate php file for every action function of a controller in magento 1.9.2.2?

Was it helpful?

Solution

It depends on the complexity of your module.

The most important thing is to separate your business logic from your mage1 module. The "pure php" part of that module can be easily ported to your mage2 module.

Then start by creating a skeleton of the module from zero in mage2. As you've seen, the structure is completely different: config files, how you declare your routers, how you interact with the db etc.

When you have your mage2 skeleton, start copying your business logic from mage1 making the necessary adjustments.

It is NOT an easy process and many chose to rewrite their modules from zero.

And yes in magento 2 you need different files for your action functions.

This may be an useful resource: http://www.developers-paradise.com/wp-content/uploads/2016/05/03-Fabian-Schmengler-Porting-a-complex-extension-to-Magento-2.pdf

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top