webplus Posted August 9, 2012 Share Posted August 9, 2012 Hi, my question is related to Prestashop 1.5. Module bankwire now contains file /bankwire/controllers/front/payment.php which overrides ModuleFrontController.php. It removes the left column during bankwire payment. I want to change this for my theme so I wonder if I can override it within theme? I tried to change it via /themes/mytheme/modules/bankwire/controllers/front/payment.php but it doesn't work. Thanks for any tips! Link to comment Share on other sites More sharing options...
Martin89 Posted November 16, 2012 Share Posted November 16, 2012 I have the same problem! Link to comment Share on other sites More sharing options...
CartExpert.net Posted November 16, 2012 Share Posted November 16, 2012 I have the same problem! Hi. First you need to edit global.css line 1703 (if default theme) and remove: #module-bankwire-payment #left_column { display: none; } Then edit 'modules/bankwire/controllers/front/payment.php' and remove line 33: public $display_column_left = false; Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
webplus Posted November 17, 2012 Author Share Posted November 17, 2012 (edited) Hi CartExpert, thank you for your answer. Yes I know, but I was hoping I will be able to OVERRIDE this feature WITHIN THE THEME. Jiri Edited November 17, 2012 by webplus (see edit history) Link to comment Share on other sites More sharing options...
CartExpert.net Posted November 19, 2012 Share Posted November 19, 2012 Hi. The module PHP files never had the option to be overridden. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
webplus Posted November 21, 2012 Author Share Posted November 21, 2012 Thanks Robin! I think this is quite a limitation for the theme developers :-( Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 21, 2012 Share Posted November 21, 2012 Hi, webplus, but you may disable bankwire during install your template, and create the new module (ex. webplus_bankwire) where you may override it logic. Regards Link to comment Share on other sites More sharing options...
webplus Posted November 23, 2012 Author Share Posted November 23, 2012 Hi Alexander, thank you for joining the topic and your tip. You are right, it's probably the only possible workaround if I don't want to hide left column during checkout in theme for sale. But I would have to do the same for cashondelivery, cheque and maybe some other modules and keep them updated with every new version. I think this wasn't a good idea to hardcode hiding of column into modules, as it limits theme developers in case they just don't want to hide the left column during checkout. Thanks everyone. I'm just not sure if I should mark the topic as solved Link to comment Share on other sites More sharing options...
NemoPS Posted November 29, 2012 Share Posted November 29, 2012 Hey, i just want to drop in my .2 about this. Why is the Prestashop team ignoring this AWFUL module behavior? There are a couple of issues opened in the forge, and i also opened another topic about this, but both are being ignored. geez. For the time being, I'm giving my custoemrs a front controller override where the "hide columN" command has been disabled. But this is a pain! Furthermore, even if for some reason it was possible to override the modules' php files, this would have meant adding tons of overrides, since a whole lot of modules interfere with the layout. What do you think? I'd say: let's massively tell the prestashop team to remove this stupid feature, which is making life much harder to all theme developers! Cheers! 4 Link to comment Share on other sites More sharing options...
Dh42 Posted November 29, 2012 Share Posted November 29, 2012 Why not create a module with your themes that installs a new hook on the left side, and during the theme install have the modules installed to the new hook. Link to comment Share on other sites More sharing options...
Dreamtheme Posted December 29, 2012 Share Posted December 29, 2012 Why not create a module with your themes that installs a new hook on the left side, and during the theme install have the modules installed to the new hook. Because it will be a work around, and this will make conflicts with feature modules that user may install on this theme I have also submitted the problem as bug http://forge.prestashop.com/browse/PSCFV-5001 they are working on a solution 1 Link to comment Share on other sites More sharing options...
Dh42 Posted December 29, 2012 Share Posted December 29, 2012 I haven't thought about this in a long time, but am I wrong in thinking that if you use your own classes and names that the modules cannot hide the columns? Link to comment Share on other sites More sharing options...
NemoPS Posted December 29, 2012 Share Posted December 29, 2012 Because it will be a work around, and this will make conflicts with feature modules that user may install on this theme I have also submitted the problem as bug http://forge.prestas...owse/PSCFV-5001 they are working on a solution That's the exact forge issue i was talking about Anybody knows if this has been fixed in 1.5.3? Link to comment Share on other sites More sharing options...
Dreamtheme Posted December 29, 2012 Share Posted December 29, 2012 Unfortenatley it is not fixed. Link to comment Share on other sites More sharing options...
Dreamtheme Posted December 29, 2012 Share Posted December 29, 2012 (edited) I haven't thought about this in a long time, but am I wrong in thinking that if you use your own classes and names that the modules cannot hide the columns? You can do it if you export module, but for themes is bad. In themes is not good to use your own classes, because it makes installation harder for users to understand when they need to upload/preserve classes with upgrades/installs, it would be ok if ThemeInstaller export/import override classes, but until then it is not good idea. Edit: The only reasonable solution is either PrestaShop fix this, or you should make a custom module in which you can put your override class so it can be exported and imported with theme installer. Edited December 29, 2012 by Dreamtheme (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted December 29, 2012 Share Posted December 29, 2012 Oh Jeez. What are they thinking? This is what makes me wonder how long Prestashop will survive. Customization ease is going nuts Link to comment Share on other sites More sharing options...
Dreamtheme Posted December 29, 2012 Share Posted December 29, 2012 Oh Jeez. What are they thinking? This is what makes me wonder how long Prestashop will survive. Customization ease is going nuts I saw from 1.4.x to 1.5.x at least 20 developers who abandoned PrestaShop, with 1.5.x PS showed that they don't care for developers, customizing or backward compatibility, if this behavior continue i bet PS future won't be bright. Link to comment Share on other sites More sharing options...
NemoPS Posted December 29, 2012 Share Posted December 29, 2012 I saw from 1.4.x to 1.5.x at least 20 developers who abandoned PrestaShop, with 1.5.x PS showed that they don't care for developers, customizing or backward compatibility, if this behavior continue i bet PS future won't be bright. Agreed, i also work with Wordpress, and there is, among the others, one HUGE difference between the two project: Wordpress is designed to be extended, for the end user and developers. Prestashop seems to have been created to advertise some partners, more and more... and more! Sad. 1 Link to comment Share on other sites More sharing options...
mhume Posted February 26, 2013 Share Posted February 26, 2013 Hi I'm very new here and to this cart but surely you just edit /override/classes/module/Module.php to <?php abstract class Module extends ModuleCore { /** * Return an instance of the specified module * * @param string $module_name Module name * @return Module */ public static function getInstanceByName($module_name) { if (!Validate::isModuleName($module_name)) die(Tools::displayError()); if (!isset(self::$_INSTANCE[$module_name])) { if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$module_name.'/'.$module_name.'.php')) { include_once(_PS_THEME_DIR_.'modules/'.$module_name.'/'.$module_name.'.php'); if (class_exists($module_name, false)) return self::$_INSTANCE[$module_name] = new $module_name; } if (Tools::file_exists_cache(_PS_MODULE_DIR_.$module_name.'/'.$module_name.'.php')) { include_once(_PS_MODULE_DIR_.$module_name.'/'.$module_name.'.php'); if (class_exists($module_name, false)) return self::$_INSTANCE[$module_name] = new $module_name; } return false; } return self::$_INSTANCE[$module_name]; } } Its ment for editing core features! I just added the lines to the getInstanceByName() function that make it first search the theme directory for the php file first i.e. /themes/my_theme/modules/my_module/my_module.php If it finds one it uses it You may want to redirect it to a more v1.5 path Cheers mh Link to comment Share on other sites More sharing options...
Dreamtheme Posted February 26, 2013 Share Posted February 26, 2013 There are several problems with this approach. 1. The problem with overriding default behavior is that this php files should be placed manually, and will not work with Theme Installer module, this means that users will have to do manual stuff and this is always bad. 2. The second problem is updates, if the users upgrades his version he will lose this and he must do it again. 3. You then should mark your theme as "core modified" in addons store which is bad. The only viable solution should be to imbed some kind of class override inside some custom module. However i think that this is just very bad, because showing or hiding columns should be CSS controlled only! And it was that before, i don't know what gone wrong in 1.5.x 1 Link to comment Share on other sites More sharing options...
mhume Posted February 26, 2013 Share Posted February 26, 2013 (edited) Excuse my ignorance, i am new Think we're coming at the problem from different paths I was looking at a way to modify the core modues without actually editing them. So they'd live on through upgrades etc. (Are you sure an upgrade will overwrite stuff in the \override folder?) Just looked through the manual upgrade steps and the \override folder is replaced. Thats a bit rubbish! I see that you're more interested in being able to package a theme and have it work without touching anything system (or at least not have your users have to touch it) Your point is valid as column hiding should be CSS controled. mh Edited February 26, 2013 by mhume (see edit history) Link to comment Share on other sites More sharing options...
Dreamtheme Posted February 26, 2013 Share Posted February 26, 2013 No problem i welcome your attempt My experience shows that users have difficulty installing simple logo in PrestaShop, and forcing them to override files will make things much worse That's why this problem should be solved foolproof, and i think only PrestaShop team can do it. Link to comment Share on other sites More sharing options...
Dh42 Posted February 26, 2013 Share Posted February 26, 2013 Would I be wrong in thinking that all you would have to do is write in a jquery routine, on page, that would unhide the element? As an alternative couldn't you just by pass this by not using the standard left column naming convention in your theme? Link to comment Share on other sites More sharing options...
Dreamtheme Posted February 26, 2013 Share Posted February 26, 2013 Would I be wrong in thinking that all you would have to do is write in a jquery routine, on page, that would unhide the element? As an alternative couldn't you just by pass this by not using the standard left column naming convention in your theme? I don't understand, how you will override public $display_column_left = false; in bankwire module with jquery? Link to comment Share on other sites More sharing options...
Dh42 Posted February 26, 2013 Share Posted February 26, 2013 I haven't looked at it in a while, but I am pretty sure that setting that variable to false, just initiates a jquery .hide() on the column. Its still on the page, it just needs to be displayed. Link to comment Share on other sites More sharing options...
Dreamtheme Posted February 26, 2013 Share Posted February 26, 2013 // Call hook before assign of css_files and js_files in order to include correctly all css and javascript files $this->context->smarty->assign(array( 'HOOK_HEADER' => $hook_header, 'HOOK_TOP' => Hook::exec('displayTop'), 'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''), Its seems to be hook, nothing to do with jquery. Link to comment Share on other sites More sharing options...
Dh42 Posted February 26, 2013 Share Posted February 26, 2013 Ahh, you got me on that, I looked at it once a long time ago and I noticed that the left column on the bankwire page was set to display:none; I didn't look at the element to see that it was blank Link to comment Share on other sites More sharing options...
Dh42 Posted February 26, 2013 Share Posted February 26, 2013 I am just making a guess here, and you can tell me if I am wrong. I usually design one off themes for clients, so I don't have the expertise in developing themes for distribution. What would it do if you wrote a module and distributed it with your theme. The module just basically hooks into the foot and re sets the variable on the left column. Link to comment Share on other sites More sharing options...
Dreamtheme Posted February 26, 2013 Share Posted February 26, 2013 Well, i state it before, to make external module is the only good solution. But this will take resources and will slow down PS even more. I have run bug report about it long ago, and Vincent AUGAGNEUR said: "At the moment we are currently stabilise the version 1.5. We are working about found a solution on this problem too." But this was back in October, 5 months later and nothing yet about it. Link to comment Share on other sites More sharing options...
Dh42 Posted February 26, 2013 Share Posted February 26, 2013 I don't think a module like that would slow things down any noticeable bit, plus it would realistically have taken have the time to make as we have spent posting about it. Link to comment Share on other sites More sharing options...
Dreamtheme Posted February 26, 2013 Share Posted February 26, 2013 Well make one for everyone 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