danielevigi Posted January 13, 2014 Share Posted January 13, 2014 (edited) Is there a hook to change price (to all products) or to aplly a price reduction? Edited January 13, 2014 by danielevigi (see edit history) Link to comment Share on other sites More sharing options...
krisives Posted January 13, 2014 Share Posted January 13, 2014 Hooks are used to respond to things that happen in Prestashop but don't let you modify the behaviour; to do that you need to override a class. You're probably going to want to override Product::getPriceStatic https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Product.php#L2487 Link to comment Share on other sites More sharing options...
danielevigi Posted January 13, 2014 Author Share Posted January 13, 2014 (edited) Hooks are used to respond to things that happen in Prestashop but don't let you modify the behaviour; to do that you need to override a class. You're probably going to want to override Product::getPriceStatic https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Product.php#L2487 Thanks for the reply. Can I put the override inside a module? So I can disable it when I no longer need. Edited January 13, 2014 by danielevigi (see edit history) Link to comment Share on other sites More sharing options...
danielevigi Posted January 13, 2014 Author Share Posted January 13, 2014 Thanks for the reply. Can I put the override inside a module? So I can disable it when I no longer need. I answer myself: yes, it's possible, just put override files (with correct folders structure) inside my module folder. Link to comment Share on other sites More sharing options...
krisives Posted January 13, 2014 Share Posted January 13, 2014 Starting in PrestaShop 1.5 you can do module overrides. I don't think multiple modules can extend the same class, but I could be wrong on that. Link to comment Share on other sites More sharing options...
vekia Posted January 13, 2014 Share Posted January 13, 2014 unfortunately, it's not possible to override the same class from several modules.. you can override class only from one module. 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