Jump to content

Want to know hook name which can work on page configpromotions.php?action=manage


Recommended Posts

Hi Brian,

Thanks for your reply. I had also created following ticket with Support was redirected to community. My ticket query was:

At first I would like to ask how to add custom html element Checkbox below "Existing Client Apply to existing clients only (must have an active order to qualify)"? When checked this checkbox my custom added check box should open. And when my custom check box is checked a new html element will open Select Existing clients. This will multiselect dropdown list having all existing client value will be userid and display will be client names. How to get existing client list that is my 2nd query.

Below is the hook example found at https://developers.whmcs.com/hooks-reference/admin-area/#adminareapage.

add_hook('AdminAreaPage', 1, function($vars) {
    $extraVariables = [];
    if ($vars['filename'] == 'index.php') {
        $extraVariables['newVariable1'] = 'thisValue';
        $extraVariables['newVariable2'] = 'thatValue';
    }
    return $extraVariables;
});
Would like to confirm few things:

add_hook('AdminAreaPage', 1, function($vars) {
    $extraVariables = [];
    if ($vars['filename'] == 'configpromotions.php?action=manage') {
        $extraVariables['newCheckBoxValue'] = 'thisValue';
    }
    return $extraVariables;
});
Will work on page while creating new coupon?

Can you help me to achieve my goal using admin area hooks? I'll post my further queries later since its not allowing to post large text in comment.

Will be awaiting your reply.

Regards,

Shubhajeet Saha

Link to comment
Share on other sites

Hi Brian,

I have added below code and working fine:

add_hook('AdminAreaFooterOutput', 1, function($vars) {
    if($vars['filename'] == 'configpromotions'){
        return <<<HTML
            <b>This is a custom output on the footer</b>
            <script type="text/javascript">
                $('input[name="existingclient"]').change(function() {
                    if(this.checked) {
                        var html='<tr><td class="fieldlabel">Restrict to Specific Client?</td><td class="fieldarea"><label class="checkbox-inline"><input type="checkbox" name="restricted" value="1"> Restricted to selected clients only</label></td></tr>';
                        var elem= $(this).closest('tr').after(html);
                    }
                });
                $(document).on('change','input[name="restricted"]',function() {
                    if(this.checked) {
                        var html='<tr><td class="fieldlabel">Select Clients</td><td class="fieldarea"><select type="checkbox" name="restrictedto" multiple size="8"><option value="1">Client 1</option><option value="2">Client 2</option><option value="3">Client 3</option> </select></label></td></tr>';
                        var elem= $(this).closest('tr').after(html);
                    }
                });
            </script>
HTML;
    }
});

Now I have to display a list of all existing clients with active order in the list. Currently I have manually displayed Client 1, Client 2, Client 3 in the dropdown list.

 

Also I would like to know how I can store the values to the tblpromotions. I have already created restricted column next to existingclient column with default value 0 and next to restricted column  added another column restrictedto to store client's user id.

Awaiting for your help on this...

Regards,

Shubhajeet Saha 

Link to comment
Share on other sites

18 minutes ago, bear said:

Team?
Do we get uniforms?

yes - you can pick them up from Reception, but you have to pay for them now! they update their design every month and unless you agree to buy & wear their latest design, you're no longer allowed to reply! lol 🤑

R11RfLg.jpgRq86IQu.jpg

1 hour ago, bear said:

Kidding aside, this is a user to user community, mostly, and not so many actually from WHMCS. As such, responses are not always prompt.

and in this case, not at all from me. 🤐

Link to comment
Share on other sites

2 hours ago, brian! said:

yes - you can pick them up from Reception, but you have to pay for them now! they update their design every month and unless you agree to buy & wear their latest design, you're no longer allowed to reply! lol 🤑

R11RfLg.jpgRq86IQu.jpg

and in this case, not at all from me. 🤐

If you arrange to have these made with the proceeds going to charity - I will buy 😂

Link to comment
Share on other sites

5 hours ago, webtechwhiz said:

Dear Team,

Awaiting for assistance....

Regards,

Shubhajeet Saha

If you need urgent assistance, It would be better to use support on whmcs.com. I am of the opinion they won't be able to help today, But premium support arrives tomorrow so 🤞 they may have employed some capable people to suprise us all!

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