kramlv Posted September 3, 2016 Share Posted September 3, 2016 Hello! Is there any analogue of OpenCart's vqmod for PrestaShop? What is the best way to make changes in the core PrestaShop files (php, tpl...)? Thank You Link to comment Share on other sites More sharing options...
kramlv Posted September 9, 2016 Author Share Posted September 9, 2016 (edited) So, for example if I want to hide field in tpl (I use "hide" class), or I want to configure permanent BCC in mail.php I can do it without touching source, by creating override files? I am asking about correct development concept, because I want to make changes, that are upgradable. P.S. Started to investigate links, that You mentioned. I can not understand, how I point at what place override should put additions or changes. Can You please help? Thank You. Edited September 9, 2016 by kramlv (see edit history) Link to comment Share on other sites More sharing options...
kramlv Posted September 15, 2016 Author Share Posted September 15, 2016 Anybody? Please help me. Link to comment Share on other sites More sharing options...
rocky Posted September 18, 2016 Share Posted September 18, 2016 Simply find the class or controller you want to change and then create a file with the same directory and filename inside the override directory in the root. For example, if you want to override classes/Address.php, create override/classes/Address.php with the following: <?php class Address extends AddressCore { } You can then choose to override a function like this: public function __construct() { AddressCore::$definition['fields']['lastname']['size'] = 64; parent::__construct(); } You can choose to add your own code and then call the parent function, call the parent function first and then add your own code, or you can copy the parent function in it's entirety and modify any part of the code you want. You also need to go to Advanced Parameters > Performance and click the "Clear cache" button (or manually delete cache/class_index.php) each time you add an override so PrestaShop can find it. Link to comment Share on other sites More sharing options...
kramlv Posted September 19, 2016 Author Share Posted September 19, 2016 (edited) Thank you for the clarifications about changing code. If I want to make changes in the default template .tpl and .css , the best way is to copy default theme? Correct? Edited September 19, 2016 by kramlv (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 20, 2016 Share Posted September 20, 2016 Yes, to override a module's TPL file, CSS or JavaScript, copy it to themes/<your_theme>/modules/<module_name>/<template_name>, themes/<your_theme>/css/modules/<module_name>/<stylesheet_name> or themes/<your_theme>/js/modules/<module_name>/<javascript_name> directories. 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