ealio Posted September 8, 2013 Share Posted September 8, 2013 How to override the class of "/modules/blockreinsurance/blockreinsurance.php" ? Thanks. 1 Link to comment Share on other sites More sharing options...
vekia Posted September 8, 2013 Share Posted September 8, 2013 unfortunately it isn't possible to override module .php file. You can only override module: tpl files css files js files images 1 Link to comment Share on other sites More sharing options...
ealio Posted September 9, 2013 Author Share Posted September 9, 2013 unfortunately it isn't possible to override module .php file. You can only override module: tpl files css files js files 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 More sharing options...
PascalVG Posted September 9, 2013 Share Posted September 9, 2013 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 More sharing options...
El Patron Posted September 9, 2013 Share Posted September 9, 2013 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 More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 but in this case .php file will not be overrided, and module will use original one Link to comment Share on other sites More sharing options...
ealio Posted September 10, 2013 Author Share Posted September 10, 2013 but in this case .php file will not be overrided, and module will use original one correct. Link to comment Share on other sites More sharing options...
heyho Posted January 27, 2014 Share Posted January 27, 2014 And how can i override this .php File? Link to comment Share on other sites More sharing options...
vekia Posted January 28, 2014 Share Posted January 28, 2014 it's not possible to override module php files. Link to comment Share on other sites More sharing options...
toanloau Posted March 2, 2014 Share Posted March 2, 2014 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! Link to comment Share on other sites More sharing options...
vekia Posted March 2, 2014 Share Posted March 2, 2014 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 More sharing options...
dojoVader Posted March 22, 2014 Share Posted March 22, 2014 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 More sharing options...
wakabayashi Posted July 28, 2014 Share Posted July 28, 2014 Is it still not possible to overwrite .php files from module? I dont make a lot of changes. Mostly i only change hook. How should I do that? I mean it works now great, but on click to update and my changes are lost... Link to comment Share on other sites More sharing options...
bellini13 Posted July 29, 2014 Share Posted July 29, 2014 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 More sharing options...
HaCos Posted November 28, 2014 Share Posted November 28, 2014 In case we want to assign the module with a new custom hook, is there any other approach? Link to comment Share on other sites More sharing options...
bellini13 Posted November 28, 2014 Share Posted November 28, 2014 In case we want to assign the module with a new custom hook, is there any other approach? be more specific about what you want to do 1 Link to comment Share on other sites More sharing options...
HaCos Posted November 28, 2014 Share Posted November 28, 2014 be more specific about what you want to do Create a new custom hook [toprighthead] in my template & assing a module [blockuserinfo] with it. Link to comment Share on other sites More sharing options...
bellini13 Posted November 29, 2014 Share Posted November 29, 2014 Have you read through this guide? http://doc.prestashop.com/display/PS16/Managing+Hooks Link to comment Share on other sites More sharing options...
Guest Posted May 4, 2015 Share Posted May 4, 2015 For versions 1.6.0.11 and upwards there is a solution: http://nemops.com/override-prestashop-modules-core/#.VUeQEvyqpBc Link to comment Share on other sites More sharing options...
pxwee5 Posted October 20, 2015 Share Posted October 20, 2015 Akhenaten & Razaro are champions! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now