Results 1 to 3 of 3

Thread: perform action after inserting new catalog item

  1. #1
    New user
    Join Date
    06-28-10.
    Posts
    1

    Default 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.

  2. #2
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default 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') );

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •