xezus Posted September 1, 2013 Share Posted September 1, 2013 (edited) Hi guys I not sure if it's just my problem or if it's some prestashop bug. The problem is I am overriding two classes Category.php and Link.php after install is everything ok, but when I what to reset the module I get a error Cannot install this module. Unable to install override: directory (C:\xampp\htdocs\prestashop\override\override/classes) not writable As you can see it adds twice override\override into the path. Only solution I found working is to remove the overriding classes reset the module add them again reset the module, and then it works. I tested this on prestashop 1.5.5 and 1.5.4 and I got the same result. Has anyone the same problem? Edited September 1, 2013 by El Patron (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted September 1, 2013 Share Posted September 1, 2013 this is for a PS 1.4 yes? Link to comment Share on other sites More sharing options...
xezus Posted September 1, 2013 Author Share Posted September 1, 2013 Hello, no for 1.5.4.0 and above Link to comment Share on other sites More sharing options...
El Patron Posted September 1, 2013 Share Posted September 1, 2013 did you place your overrides in your module folder like this? modules/modulename/override/classes/(your overridde) ps then should, during a reset, uninstall and then re-install to the root/override/classes/(your override) Link to comment Share on other sites More sharing options...
xezus Posted September 1, 2013 Author Share Posted September 1, 2013 Yes I have modules/modulename/override/classes/Category.php modules/modulename/override/classes/Link.php And with the first install It's everything ok. They are install in root/override/classes But during reinstall I get the above error and module is not install, and the classes in root/override/classes are still there. They are not removed or uninstall. Link to comment Share on other sites More sharing options...
xezus Posted September 1, 2013 Author Share Posted September 1, 2013 Do I have to add some uninstall function for the overrided classes? Because if I remove them from root/override/classes, and then tried the reinstall it works ok. Link to comment Share on other sites More sharing options...
El Patron Posted September 1, 2013 Share Posted September 1, 2013 I can't reproduce this with one of my modules, using reset, it has one class override. I checked my code and I don't do anything special at uninstall or install as this is taken care of by ps. see this post to see if it helps, http://www.prestashop.com/forums/topic/238197-solved-overrides-not-working-anymore-in-154/ Link to comment Share on other sites More sharing options...
xezus Posted September 1, 2013 Author Share Posted September 1, 2013 Thanks, but nothing works for me. Could you please send me any module with working class override? Link to comment Share on other sites More sharing options...
El Patron Posted September 1, 2013 Share Posted September 1, 2013 you can visit my shop and download free module ip simulator... 1 Link to comment Share on other sites More sharing options...
xezus Posted September 1, 2013 Author Share Posted September 1, 2013 Thank you El Patron I found why it didn't work thanks to your module. I was trying to override the class in a bad way. Link to comment Share on other sites More sharing options...
El Patron Posted September 1, 2013 Share Posted September 1, 2013 you welcome, glad to help. in the future when you order free modules from developers, please take the time to register with good credentials, i.e. no iadf lhadf jajaja...it makes us and our work feel more appreciated. Link to comment Share on other sites More sharing options...
meccabooks Posted December 1, 2013 Share Posted December 1, 2013 I am getting below error when I am trying to install below module - ILLICOPRESTA_P15_StockManagement : Unable to install override: The method getAllProductSupplierPrice in the class ProductSupplier is already overriden. Urgent help will be appreciated.. Link to comment Share on other sites More sharing options...
meccabooks Posted December 1, 2013 Share Posted December 1, 2013 this is my code in the file ProductSupplier.php <?php class ProductSupplier extends ProductSupplierCore { public static function getAllProductSupplierPrice($id_product, $id_product_attribute, $with_currency = false) { // build query $query = new DbQuery(); $query->select('ps.product_supplier_price_te, s.name as supplier_name'); if ($with_currency) $query->select('ps.id_currency'); $query->from('product_supplier', 'ps'); $query->where('ps.id_product = '.(int)$id_product.' AND ps.id_product_attribute = '.(int)$id_product_attribute ); $query->leftJoin('supplier', 's', 'ps.id_supplier = s.id_supplier'); if (!$with_currency) return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); } } Link to comment Share on other sites More sharing options...
El Patron Posted December 1, 2013 Share Posted December 1, 2013 I am getting below error when I am trying to install below module - ILLICOPRESTA_P15_StockManagement : Unable to install override: The method getAllProductSupplierPrice in the class ProductSupplier is already overriden. Urgent help will be appreciated.. the error is just as stated, and the module will need to be installed 'manually'. there is already existing in your override/classes ProductSupplier.php you will need to merge the function getAllProductSupplierPrice with the new override... Link to comment Share on other sites More sharing options...
meccabooks Posted December 1, 2013 Share Posted December 1, 2013 So, I just copy the file via FTP to the module folder.. instead of "installing" it via adminPanel.. I can do that however I dont know how to do below.. "you will need to merge the function getAllProductSupplierPrice with the new override..." Link to comment Share on other sites More sharing options...
matzmu Posted December 1, 2013 Share Posted December 1, 2013 meccabooks: you need rewrite function - and join two function into one Link to comment Share on other sites More sharing options...
meccabooks Posted December 1, 2013 Share Posted December 1, 2013 meccabooks: you need rewrite function - and join two function into one How do I do that? Link to comment Share on other sites More sharing options...
meccabooks Posted December 1, 2013 Share Posted December 1, 2013 the error is just as stated, and the module will need to be installed 'manually'. there is already existing in your override/classes ProductSupplier.php you will need to merge the function getAllProductSupplierPrice with the new override... So I uploaded the files via FTP, and still same thing is issue, I need to "install" it and when I do that I get the same error.. so question is how to I merge the function.. I believe if I merge the function, and than install the module it will work.. Link to comment Share on other sites More sharing options...
matzmu Posted December 1, 2013 Share Posted December 1, 2013 I think you need someone to do this for you, if you havn`t programming skills 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