Jump to content

Right way to create a new module?


jphuttun

Recommended Posts

Hi!

I created a new ability to Prestashop (Back Office) Catalog Evaluation module. New ability allow BO user to add "lower than" and "greater than" stock values to every product (if wanted). This really helps you find the products that are almost out of stock if you have bulk and unique products mixed in you store.

To create this ability I injected code to Catalog Evaluation module - which I supposed was the wrong way to start creating a new module. I tried to search answers from prestashop wiki, but I didn't find useful information about this topic (I found developers guide, but topics were stub).

So, now I ask, what is the right way to create a new module (that development of Prestashop versions is not problem to installing the module that I created)? There are some options that I figured out:
-Install function injects code to target module? Easy, but risky (I suppose that errors will occur in the long run)
-How about I create a new class that inherits from original module? How about installing this kind of module (extension for old module or a completely new module?)
-A completely new module that includes old Catalog Evaluation files (files in statscheckup folder) and my derivatived work inside the files (which I publish under OSL 3.0 license)?
-Some other way?

I suppose there is recommeded way to make these modules, but I don't know what that is. So, any comments?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...