Hello. So I was surfing the internet and I found a store, which has price history for each product which I found really interesting and great way for customer to show what prices the products have a week ago or yesterday. My current store has 1700 products, which are automatically update every night at 00:00 with a cronjob I made(the data is being taken from my suplier\’s xml file). So all of the products are being update every night. I found this event in magento: catalog_controller_product_init_after from what I think, it is used after opening a product? So if I create a module, which reads and saves the price after update I could use the data to make a chart or a table? If the catalog_controller_product_init_after is actually used like that, I would like to know how could I use it? Whether it should be used in a helper or in a model. I am kind of new to creating modules, but I’m not new to php, so I’m still in magento module creating learning mode
Obviously the data needs to be saved in mysql.
So I need to know if catalog_controller_product_init_after is a event, which loads a function(for example) after a product save and if so, I would like to get some tips on using this event
I think this would be a really great module for all those who use cronjobs to update prices from their suppliers
if I get it working, I would share it with the community
I’m using Magento community edition 18.104.22.168. Thank you for your replies and support
Attached a example of the price history I found on the internet.
Just found this code on the forums, which helped with the event. Now the question remains the same: is catalog_controller_product_init_after executed after saving a product?
public function some_event_handle($observer)
$event = $observer->getEvent();
$order = $event->getOrder();
$customer = $event->getCustomer();
// ... add my custom code to be spawned during the event
// ... may update the argument objects, or do any other action.
Click thumbnail to see full-size image