Jump to content

How to override the class of "/modules/blockreinsurance/blockreinsurance.php" ?


ealio

Recommended Posts

 

unfortunately it isn't possible to override module .php file.

You can only override module:

  1. tpl files
  2. css files
  3. js files
  4. images

 

Thanks a lot for your information. So, if we want to change a module's behavor, we have to create a new module? Because if we changed the module .php file directly, the module can't be upgraded. Not sure if it will affect Prestashop's upgrade!

Link to comment
Share on other sites

Creating a (modified) copy would be a good idea, you'd be independent from updates. Best is to clearly document what you change though, as new versions of original Prestashop modules may include interesting functionality, so when having well documented changes, you can do the upgrade to the new module quickly.

 

pascal

Link to comment
Share on other sites

Thanks a lot for your information. So, if we want to change a module's behavor, we have to create a new module? Because if we changed the module .php file directly, the module can't be upgraded. Not sure if it will affect Prestashop's upgrade!

 

You could however copy this module into your themes/yourtheme/modules...and it would be safe from upgrades

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

how to i override tpl files of another module, i'm writing module that can change behavor in file exist tpl. I use prestashop 1.5.6, i want put it on my own module folder.

sorry for my english!

Thank advance!

http://doc.prestashop.com/display/PS15/Overriding+default+behaviors

 

especially this part: http://doc.prestashop.com/display/PS15/Overriding+default+behaviors#Overridingdefaultbehaviors-Overridingamodule%27sbehavior

Link to comment
Share on other sites

  • 3 weeks later...

Ideally by conventions its not allowed, The overriding of Modules from theme, However i created a file that checks the parent Module and generates a copy and modifies the name and loads the one in your theme, and if it doesn't exist it picks the old one. it might not be ideal but its necessary for me in terms of MultiShop, Different themes but same Moodle. it works for Prestashop 1.6 

Link to comment
Share on other sites

  • 4 months later...

module .php files cannot be overriden.  you either ...

 

1) update the module directly (not recommended),

2) you make a copy of the module and apply your changes (you would need to rename the module, and recode it)

3) another approach is to create your functionality in a controller or class that is used by this modules hook, and do that via a controller/class override.  this may or may not be possible, depending on what you are trying to accomplish

4) similar to 3, you would create your functionality in a controller or class override (add a new function).  Then edit the original module to invoke that code.  This way you would not lose your custom coding, and you only need to remember to add that 1 line of code when you upgrade the module.

Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...
  • 5 months later...

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...