Jump to content

How to skip some products AfterModuleCreate


Swehoster

Recommended Posts

Hi,
I need help with a hook "AfterModuleCreate".
I need it to skip running on certain products.
I've tried with the following:

add_hook("AfterModuleCreate",0,"runFeatureHook","");

if (!($vars['params']['pid'] === '123') || ($vars['params']['pid'] === '124') || ($vars['params']['pid'] === '125')) {

function runFeatureHook($vars) {
  my-function
}
}

Best regards
Fredrik

Link to comment
Share on other sites

23 minutes ago, Swehoster said:

I just can't understand why this doesn't work?

hang on, shouldn't you be using PreModuleCreate instead ??

  • AMC -> Executes upon successful completion of the module function.
  • PMC -> Executes prior to the module create function being run for a service. Allows the action to be aborted.
Link to comment
Share on other sites

7 minutes ago, brian! said:

hang on, shouldn't you be using PreModuleCreate instead ?? 

I was about to say. That's why I asked what he was trying to skip. 😛

As far as I can think, the only thing you would be able to skip is the email sending.

You can skip module create by returning abortcmd=true

Edited by DennisHermannsen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated