Aiman H Posted October 23, 2022 Share Posted October 23, 2022 Hello, I want to show a green notification banner for only 3 or 4 clients, so we will use Client ID as argument. How can I show this banner for selected clients with a link to order a single hidden package 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted October 23, 2022 Share Posted October 23, 2022 Use Add a promotional offer panel and add a check of your client ids in_array. 1 Quote Link to comment Share on other sites More sharing options...
Aiman H Posted October 23, 2022 Author Share Posted October 23, 2022 (edited) @pRieStaKos Thank you for your reply. Can you please Share an example if possible. <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $thankYouMessage = <<<EOT <p>Thanks for beta testing our latest offerings! To show our appreciation we would like to provide next month of service <strong>on the house</strong>.</p> EOT; // Add a homepage panel with a link to a free month promo and mode it to the // front of the panel list. $homePagePanels->addChild('thanks', array( 'clientid' => 'ClientID1,ClientID2,ClientID3', 'label' => 'Thanks for the help!', 'icon' => 'fa-thumbs-up', 'order' => 20, 'extras' => array( 'color' => 'gold', 'btn-link' => 'https://example.org/free-month-promo', 'btn-text' => 'Redeem Your Free Month', 'btn-icon' => 'fa-arrow-right', ), 'bodyHtml' => $thankYouMessage, 'footerHtml' => 'Act fast! This offer expires soon!', )); }); is it Good or I made a mistake in syntax Edited October 23, 2022 by Aiman H 0 Quote Link to comment Share on other sites More sharing options...
brutno Posted October 24, 2022 Share Posted October 24, 2022 Define customer group for your customers. Then synchronize the customer group with the variable on the clientarehomepage. And show your message 0 Quote Link to comment Share on other sites More sharing options...
Aiman H Posted October 24, 2022 Author Share Posted October 24, 2022 Thank you brutno, but i cannot use client group for this time. Waiting an update from @Brian or @pRieStaKos 0 Quote Link to comment Share on other sites More sharing options...
bear Posted October 24, 2022 Share Posted October 24, 2022 17 minutes ago, Aiman H said: Waiting an update from @Brian or @pRieStaKos Odds are low Brian! will respond. He's off on a beach somewhere (one can hope). 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted October 24, 2022 Share Posted October 24, 2022 18 hours ago, Aiman H said: @pRieStaKos Thank you for your reply. Can you please Share an example if possible. <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $thankYouMessage = <<<EOT <p>Thanks for beta testing our latest offerings! To show our appreciation we would like to provide next month of service <strong>on the house</strong>.</p> EOT; // Add a homepage panel with a link to a free month promo and mode it to the // front of the panel list. $homePagePanels->addChild('thanks', array( 'clientid' => 'ClientID1,ClientID2,ClientID3', 'label' => 'Thanks for the help!', 'icon' => 'fa-thumbs-up', 'order' => 20, 'extras' => array( 'color' => 'gold', 'btn-link' => 'https://example.org/free-month-promo', 'btn-text' => 'Redeem Your Free Month', 'btn-icon' => 'fa-arrow-right', ), 'bodyHtml' => $thankYouMessage, 'footerHtml' => 'Act fast! This offer expires soon!', )); }); is it Good or I made a mistake in syntax Add $currentUser = CurrentUser::client(); And enclose $homePagePanels->addChild inside an if(in_array($currentUser->id, [1,2,3]) to set the panel only for users with id 1,2,3. Adjust to your needs. 1 Quote Link to comment Share on other sites More sharing options...
Aiman H Posted October 24, 2022 Author Share Posted October 24, 2022 4 hours ago, pRieStaKos said: Add $currentUser = CurrentUser::client(); And enclose $homePagePanels->addChild inside an if(in_array($currentUser->id, [1,2,3]) to set the panel only for users with id 1,2,3. Adjust to your needs. Thank you so much, Good Now. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.