If you have worked with logic hooks before, you need to make the file logic_hooks.php which goes in the directory root/custom/modules/(your module that you want this to be done in)
Mine is in public_html/custom/modules/Accounts and it looks like this PHP Code:
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['before_save'] = Array();
#first page hook-this is the hook to make the accounts status change according to a number
$hook_array['before_save'][] = Array(1, 'firstpagehook', 'custom/modules/Accounts/1stpagehook.php', 'firstpagehook', 'convertToProper');
#zip code->state this is the logic hook to change the state to match the zip code
$hook_array['before_save'][] = Array(2, 'ziphook', 'custom/modules/Accounts/ziphook.php', 'ziphook', 'convertToProper');
#address hook - this is the hook that you want to use
$hook_array['before_save'][] = Array(3, 'addresshook', 'custom/modules/Accounts/addresshook.php', 'addresshook', 'convertToProper');
?>
So if you don't have any other logic hooks in the custom module that you are using, you want it to look like this
PHP Code:
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(1, 'addresshook', 'custom/modules/Accounts/addresshook.php', 'addresshook', 'convertToProper');
?>
and then you would have a file called addresshook.php
and that would include the file that you see in the first post.
Bookmarks