ZoukLover Posted April 5, 2019 Share Posted April 5, 2019 Dear, I need to display some content on the order page. Can someone provide any help? I have added this: includes/hooks/example.php add_hook('ViewOrderDetailsPage', 1, function($vars) { $return = []; $return[] = '<a href="https://www.whmcs.com/">WHMCS</a>'; $return[] = '<a href="https://www.enom.com/">eNom</a>'; return $return; }) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 5, 2019 Share Posted April 5, 2019 3 hours ago, ZoukLover said: I need to display some content on the order page. if you check out the hooks docs, then the 'ViewOrderDetailsPage' hook doesn't return anything (arrays or HTML) - so I don't think this is an applicable hook for what you're trying to do. perhaps you should try ShoppingCartCheckoutCompletePage as that would be more suitable if we're both talking about the same page. 0 Quote Link to comment Share on other sites More sharing options...
ZoukLover Posted April 5, 2019 Author Share Posted April 5, 2019 Hi, Did a quick replace but still nothing shows: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); add_hook('ShoppingCartCheckoutCompletePage', 1, function($vars) { $return = []; $return[] = '<a href="https://www.whmcs.com/">WHMCS</a>'; $return[] = '<a href="https://www.enom.com/">eNom</a>'; return $return; }) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 5, 2019 Share Posted April 5, 2019 20 minutes ago, ZoukLover said: Did a quick replace but still nothing shows: that hook returns HTML, not an array - so you could do it like this... <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); add_hook('ShoppingCartCheckoutCompletePage', 1, function($vars) { $return = '<a href="https://www.whmcs.com/">WHMCS</a><br><a href="https://www.enom.com/">eNom</a>'; return $return; }); 0 Quote Link to comment Share on other sites More sharing options...
ZoukLover Posted April 5, 2019 Author Share Posted April 5, 2019 Dear, I see that we are talking about a different page. The page I refer to is https://www.your_domain.com/admin/orders.php?action=view&id=3630 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 5, 2019 Share Posted April 5, 2019 7 minutes ago, ZoukLover said: I see that we are talking about a different page. ok, the reason why you were trying ViewOrderDetailsPage makes sense - I missed that it was an admin hook. 🙄 24 minutes ago, ZoukLover said: The page I refer to is https://www.your_domain.com/admin/orders.php?action=view&id=3630 there wouldn't be an equivalent hook to do this on that admin page - possibly the best you could do (without resorting to js) would be to use an AdminAreaFooterOutput hook... but you would only have very limited options in where these buttons / links were located... 0 Quote Link to comment Share on other sites More sharing options...
ZoukLover Posted April 5, 2019 Author Share Posted April 5, 2019 Dear, Unfortunately whmcs is doing anything, even with incorrect php code It seams he is not using the files I put on includes/hooks/ What should I do? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 6, 2019 Share Posted April 6, 2019 if it helps, below is the hook I quickly wrote to add those links (as BS buttons, but you could change them to links if you prefer) to that page... <?php add_hook('AdminAreaFooterOutput', 1, function($vars) { if ($vars['filename'] === 'orders' && $_GET['action'] === 'view') { $return = '<div class="text-center"><a href="https://www.whmcs.com/" class="btn btn-info">WHMCS</a> <a href="https://www.enom.com/" class="btn btn-primary">eNom</a></div>'; return $return; } }); 0 Quote Link to comment Share on other sites More sharing options...
ZoukLover Posted April 6, 2019 Author Share Posted April 6, 2019 Hi, I have have the button on the products page. But still need help no the function function imsimodule_ordem_servico() { ///// need instruction to open new window with a url } function imsimodule_AdminCustomButtonArray() { $buttonarray = array( "Ordem de Servico" => "ordem_servico", ); return $buttonarray; } 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.