skyknight Posted June 27, 2013 Share Posted June 27, 2013 Hi.. I want to change invoice item description especially for domain renewal. I want to add Registrar information to domain renewal information. Any idea how to do it? Thank you. kurniawan 0 Quote Link to comment Share on other sites More sharing options...
diadyo Posted June 21, 2014 Share Posted June 21, 2014 Similar issue for me, too. I would like to change Domain Renewal - mydomain.gr - 1 Year (14/04/2015 - 13/04/2016) to Domain Renewal - mydomain.gr - annualy Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 21, 2014 Share Posted June 21, 2014 Similar issue for me, too. I would like to change Domain Renewal - mydomain.gr - 1 Year (14/04/2015 - 13/04/2016) to Domain Renewal - mydomain.gr - annualy Any ideas? do you offer more than one year for domain registration like Domain Renewal - mydomain.gr - 3 Years (14/04/2015 - 13/04/2018) 0 Quote Link to comment Share on other sites More sharing options...
skyknight Posted June 24, 2014 Author Share Posted June 24, 2014 with adding "Domain Renewal" we will know this invoice for renewal purpose. 0 Quote Link to comment Share on other sites More sharing options...
tomdchi Posted June 24, 2014 Share Posted June 24, 2014 Using the InvoiceCreationPreEmail action hook you could update the description to say whatever you wanted. http://docs.whmcs.com/Hooks:InvoiceCreationPreEmail 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 25, 2014 Share Posted June 25, 2014 Using the InvoiceCreationPreEmail action hook you could update the description to say whatever you wanted. http://docs.whmcs.com/Hooks:InvoiceCreationPreEmail this hook return nothing it will never change anything actually 0 Quote Link to comment Share on other sites More sharing options...
tomdchi Posted June 25, 2014 Share Posted June 25, 2014 Do you understand how hooks work? This hook will provide the invoice id which can be used to look up the invoice items. If your purpose is to modify a invoice line description before the invoice is sent to customer then this is the hook to use. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 25, 2014 Share Posted June 25, 2014 i think i do, if you read my comment i said that this hook do not return anything, so you mean that he will be able to update something inside DB with this hook action? 0 Quote Link to comment Share on other sites More sharing options...
tomdchi Posted June 25, 2014 Share Posted June 25, 2014 Yes, this hook will be executed after invoice generation but before the email gets sent to the client. The hook function you would create should look up the invoice line items in the database and update them as needed. So in includes/hooks/hooks.php you could have: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); add_hook("InvoiceCreationPreEmail", 1, "hook_invoice_line_edit"); function hook_invoice_line_edit($vars) { //vars from hook $souce = $vars['source']; $user = $vars['user']; $invoiceid = $vars['invoiceid']; //get invoice line items from DB $table = 'tblinvoiceitems'; $fields = 'id, type, description'; $where = array('id' => $invoiceid); $result = select_query($table, $fields, $where); //loop through line items to find ones for domains while ($line = mysql_fetch_assoc($result)) { $id = $line['id']; $type = $line['type']; $description = $line['description']; if ($type == 'Domain') { //set new description and then update tblinvoiceitems } } } Code above is not tested but should get you started. 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.