Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/31/19 in all areas

  1. Sure, it will work. I have customers with multiple brands/WHMCS provisioning services on the same servers.
    1 point
  2. sadly, that placeholder value is hardcoded and doesn't use a language string... you could argue that it not using a language string is a long-standing bug - I can't see why it couldn't use a language string for a placeholder. 🙄 one way to fix it would be a footer hook that replaces the placeholder text...
    1 point
  3. the code in your attached file works fine - except that you forgot to include a closing {/if} at line 193... without that closing IF statement, it will cause an error and display a blank area; but with it, you should see it working.
    1 point
  4. Hello @markc, Perhaps Client Groups can be of use here: https://docs.whmcs.com/Client_Groups Create a client group that has group discount of 100%, then assign your client account to this group.
    1 point
  5. Welcome to WHMCS.Community gugaldas! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
    1 point
  6. the template change below will still work in v7.8.2 if you modify domainregister.tpl and change... jQuery('.tld-filters a:first-child').click(); to... jQuery('.tld-filters a:*').click(); ... then all TLDs should be shown by default. 🙂
    1 point
  7. So I chose the hooks way to get the same implemented into the admin interface. Below is the hook to be used to make it display the required custom field's value along with the product name: <?php if ( !defined('WHMCS')) { header("Location: ../../index.php"); } use WHMCS\Database\Capsule; // Please set custom field id here. $customfieldId = 1; if($_REQUEST['getAll'] == '1') { if($_REQUEST['userid'] != '') { $all = Capsule::table('tblcustomfieldsvalues') ->join('tblhosting', 'tblcustomfieldsvalues.relid', '=', 'tblhosting.id') ->where('fieldid', $customfieldId ) ->where('userid', $_REQUEST['userid'] ) ->get(); }else { $all = Capsule::table('tblcustomfieldsvalues')->where('fieldid', $customfieldId)->get(); } $all = json_decode( json_encode( $all ) , true ); $newAll = []; foreach($all as $a) { $newAll[$a['relid']] = $a['value']; } ob_clean(); echo json_encode(array( "all" => $newAll )); die; } add_hook('AdminAreaPage', 1, function($vars) { if( $vars['filename'] == 'clientsservices' ) { echo '<script> document.addEventListener("DOMContentLoaded", function(){ $.post(window.location, { getAll: 1 }, function(data, status){ var data = JSON.parse(data); var first = []; setInterval(function() { var x = document.querySelectorAll("[data-value]"); for (var i = 1; i < x.length ; i++) { if(typeof first[x[i].dataset.value] === "undefined") { first[x[i].dataset.value] = x[i].innerText; } if(typeof data.all[x[i].dataset.value] !== "undefined" && data.all[x[i].dataset.value] != "") { x[i].innerText = first[x[i].dataset.value] + " - " + data.all[x[i].dataset.value]; } } }, 100); }); }); </script>'; } if( $vars['filename'] == 'clientshostinglist') { echo '<script> document.addEventListener("DOMContentLoaded", function(){ $.post(window.location, { getAll: 1 }, function(data, status){ var data = JSON.parse(data); var table = document.getElementById("sortabletbl1"); var rows = table.rows; for (var i = 1; i < rows.length ; i++) { if(data.all[rows[i].cells[1].innerText] != null && data.all[rows[i].cells[1].innerText] != "") { rows[i].cells[2].innerHTML = rows[i].cells[2].innerHTML+ " - " + data.all[rows[i].cells[1].innerText]; } } }); }); </script>'; } }); The only thing that needs to be setup is the $customfieldId inside the hook. Hope this is useful to someone. Thanks!
    1 point
×
×
  • 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