Jump to content

Still on overriding an existing module's php file


Recommended Posts

hello,

 

maybe a Q for the Gurus :)  Why can we not override an existing module's main php file? apologies, if this has been answered properly, but what I've found so far seems to be rather vague.

 

this is my 1st post and since my intro to Prestashop 3 weeks ago. Reading though the docs/forum I've managed to, successfully make, from simple theme/template/css tweaks to the more complex, override core classes: category, product/ add custom fields, new sql queries and rewire them including BO forms, templates etc.  The mechanism works very well and core files can be upgraded without impact since they're untouched.

 

Obviously overwriting the module's php file works fine too and with some house-keeping copies can be kept before & after the change; but why can't this be extended to say: /override/modules/blockcategories(e.g.)/blockcategories.php ??

 

Link to comment
Share on other sites

Hi Vekia,

 

Perhaps I should've phrased it better.  That is correct.  The only way I know, is to replace the module php file and keep/track the changes, in the case of upgrading.  I just needed to confirm that there is currently no better option as far as module php file goes.  Overriding everything else seems fine.

 

Would you say "/override/modules/blockwhatever/blockwhatever.php" is a reasonable place for it? perhaps as a possible future feature request??

Link to comment
Share on other sites

×
×
  • Create New...