Jump to content

Stopping code executing if NOT in group...


Recommended Posts



I hope someone can help with this one.


I have a module that performs a task globally - that is, across all customers and all groups every night with a cron job.


Basically, I just want to modify the php for the module (not a paid module), so that the the task does NOT run against a particular group I have created in the BO.


So, in essence, to write out the code in plain talk - as I understand it, it would go like this:


if in group 'xyz'

terminate task


execute task


or it may be more correct do go:


if NOT in group 'xyz'

execute task


terminate task


Is this something that is easy to do in php? I've got a very basic understanding of php and do know where it would need to go in my code - just not exactly sure on the correct syntax.


Any help would be greatly appreciated.




Link to comment
Share on other sites

I'd need a little more context as to how the module executes the task against all customers. Are you saying that the same "task" is performed nightly for each customer?


So you want to change the process, so as it iterates over each customer, we first need to decide if that customer is NOT in the 'xyz' group before executing the task?


If you'd like to share the module here, I can review the code and determine how you could implement the functionality.

Link to comment
Share on other sites

Thanks for the reply.


Basically, it is doing a search at each run for customers that have made a purchase within the previous 24 hour period and sends an email (among other things) - similar to the customer follow-up module - option 2 I guess. I just want that to run, save for it sending to members of group 'xyz'.


I thought it might have been easy to do in the php (if in group etc) just prior to the execution of the search and send - maybe it's not so easy after all?


It's a custom built module; the creator of the module is no longer available, hence this post :-(

Edited by Austra02 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...