perform action after inserting new catalog item
Hi there!
I'm looking for a easy way to call a function after adding a new catalog item. Unfortunately i don't have that much time to learn about the guts of Contao... Basically I just want to execute a small PHP-Script each time a new item has been added to the table of my catalog database. I would be very thankful for any hints where to add this function call in the catalog module.
Re: perform action after inserting new catalog item
Hi pitballs,
I've not played with catalog personally but just quickly looked at the source.
Are you adding a new item to the tl_catalog_items table?
If so, create a new module with:
dca/tl_catalog_items.php
and modify the dca for tl_catalogu_items. Ie:
Code:
$GLOBALS['TL_DCA']['tl_catalog_items']['config']['onsubmit_callback']=array( array('yournewclass','yournewmethod') );
Re: perform action after inserting new catalog item
Just watch it, because you shouldn't do that. xtra has implemented full DCA support, so you should be able to do it directly with your custom tablename, rather than tl_catalog_items, which is only a shell DCA to contain the real table dca. You'll have to get the code from him/source location...