gonandriy Posted July 7, 2010 Share Posted July 7, 2010 Can I see product price history, if price have been changed several times?Is such feature in prestashop, or I heed install some module? Link to comment Share on other sites More sharing options...
rocky Posted July 8, 2010 Share Posted July 8, 2010 PrestaShop doesn't store the history of prices. I'm not aware of any module that does this. If it is possible to write a module, it would need to add a new table where a new row is created every time a price is changed, preserving the rows with the old prices. It wouldn't work if you have already changed the prices, since it would no history to work with. Link to comment Share on other sites More sharing options...
gonandriy Posted July 12, 2010 Author Share Posted July 12, 2010 I agree with you about creating separate table for history of prices. But can I implement this without edit core source?Must I override Product class (method update) or is some other way? Link to comment Share on other sites More sharing options...
rocky Posted July 12, 2010 Share Posted July 12, 2010 You could create a module that uses the addproduct, updateproduct and deleteproduct hooks and updates the price history table. Link to comment Share on other sites More sharing options...
gonandriy Posted July 12, 2010 Author Share Posted July 12, 2010 I often think about handling events system for prestashop. For example: in ObjectModel class in method update and add (may be in some others) add event dispatcher such as dispatchEvent('add', $classname, $obj)I think in this way can be implements many extensions without editing core files. This may be very usefull. I am sorry if my post is off topic Link to comment Share on other sites More sharing options...
gonandriy Posted July 12, 2010 Author Share Posted July 12, 2010 Thanks, rockyI don't know about such hooks. Can you point me where I can read about this, or place of code, where they are implemented. Thanks in advance! Link to comment Share on other sites More sharing options...
rocky Posted July 12, 2010 Share Posted July 12, 2010 A hook is basically a placeholder in PrestaShop that modules can use to insert code. I've got a page that lists PrestaShop's hooks and a little information about how to use them here. You can find a tutorial for how to write modules here. Link to comment Share on other sites More sharing options...
gonandriy Posted July 12, 2010 Author Share Posted July 12, 2010 I have found and understand my task. My idea have now has been implemented across hooks. Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts