Jump to content

glardone

Member
  • Posts

    10
  • Joined

  • Last visited

About glardone

glardone's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. Dear all, I have modified the Domains Configuration template to add a descriptive text field for each domain in order: <div class="form-group"> <label for="RefClient">{$LANG.refclient}</label> <input type="text" class="form-control" id="RefClient" name="refclient" value="{$refclient}" /> </div> I would like to save to a custom table data entered with a hook "AfterShoppingCartCheckout". I though I did not understand how to retrieve the array of variables $refclient Thank you!
  2. Dear Sentq, thank you very much! Now it is more clear how it works... Best regards, Giorgio
  3. Dear Priestakos, thank you for your response, I modified my hook, but it's not work properly: <?php use Illuminate\Database\Capsule\Manager as Capsule; function domains($vars) { $orderid = $vars['orderid']; $domainid = array($vars['domainid']); $clientid = Capsule::table('tblorders') ->where('id',$orderid) ->get('userid'); $contacts = Capsule::table('tblorders') ->where('id',$orderid) ->get('contactid'); Capsule::table('dna_domains') ->insert( [ 'domainid', 'userid', 'contactid' => array( $params['domainid'], $params['userid'], $params['contactid'] ) ] ); } add_hook("AfterShoppingCartCheckout", 1, "dna_domains"); You have any ideas? Thank you! Best regards.
  4. Dear all, I'm trying to create a hook to insert the domains data in a custom table after the shopping cart checkout. These data are: - domainid - userid - contactid and I will use them to create a custom report about the domain holders. My code is: <?php use Illuminate\Database\Capsule\Manager as Capsule; function domains($vars) { $orderid = $vars['orderid']; $domainid = array($vars['domainid']); $clientid = Capsule::table('tblorders') ->where('id',$orderid) ->get('userid'); $contacts = Capsule::table('tblorders') ->where('id',$orderid) ->get('contactid'); mysql_query ('INSERT INTO dna_domains (domainid, userid, contactid) VALUES (?,?,?)', array( $params['domainid'], $params['userid'], $params['contactid'] ) ); } add_hook("AfterShoppingCartCheckout", 1, "dna_domains"); I'm new in WHMCS and I have not understood how interact with its variables... where I'm wrong? Thank you for support! Best regards.
  5. Hi all, I'm trying to create a hook to add the name of the registrant of a domain in the description of the invoice, so as to obtain a description of this type: Domain Registration - domainame.com - 1 Year/s (19/08/2016 - 18/08/2017) - ACME Ltd <?php function invoice_domain_registrant($vars) { $result = full_query("SELECT id, description, (SELECT (SELECT tblcontacts.companyname FROM tblcontacts WHERE id = tblorders.contactid) FROM tblorders WHERE userid ='".$vars['userid']."' AND invoiceid='".$vars['invoiceid']."') AS registrant FROM tblinvoiceitems WHERE invoiceid='".$vars['invoiceid']."'"); while($data = mysql_fetch_array ($result)) if($data['registrant'] !== NULL) // Add Company Name of contact of client update_query("tblinvoiceitems", array("description" => $data['description']." - ".$data['registrant']), array("id" => $data['id'])); } else { $result = full_query("SELECT id, description, (SELECT (SELECT tblclients.companyname FROM tblclients WHERE id = tblorders.userid) FROM tblorders WHERE userid ='".$vars['userid']."' AND invoiceid='".$vars['invoiceid']."') AS registrant FROM tblinvoiceitems WHERE invoiceid='".$vars['invoiceid']."'"); while($data = mysql_fetch_array ($result)) if($data['registrant'] !== NULL) // Add Company Name of client update_query("tblinvoiceitems", array("description" => $data['description']." - ".$data['registrant']), array("id" => $data['id'])); } add_hook("InvoiceCreationPreEmail", 1, "invoice_domain_registrant"); I do not understand what is the error, but the description does not change... Thank you.
  6. Hi all, I'm trying to create a hook to add the domain registrant name to invoice description: <?php function invoice_domain_registrant($vars) { $result = full_query("SELECT id, description, (SELECT (SELECT tblcontacts.companyname FROM tblcontacts WHERE id = tblorders.contactid) FROM tblorders WHERE userid ='".$vars['userid']."' AND invoiceid='".$vars['invoiceid']."') AS registrant FROM tblinvoiceitems WHERE invoiceid='".$vars['invoiceid']."'"); while($data = mysql_fetch_array ($result)) if($data['registrant'] !== NULL) // Add Company Name of client contact update_query("tblinvoiceitems", array("description" => $data['description']." - ".$data['registrant']), array("id" => $data['id'])); } else { $result = full_query("SELECT id, description, (SELECT (SELECT tblclient.companyname FROM tblclients WHERE id = tblorders.userid) FROM tblorders WHERE userid ='".$vars['userid']."' AND invoiceid='".$vars['invoiceid']."') AS registrant FROM tblinvoiceitems WHERE invoiceid='".$vars['invoiceid']."'"); while($data = mysql_fetch_array ($result)) if($data['registrant'] !== NULL) // Add Company Name of client update_query("tblinvoiceitems", array("description" => $data['description']." - ".$data['registrant']), array("id" => $data['id'])); } add_hook("InvoiceCreationPreEmail", 1, "invoice_domain_registrant"); I do not understand what is the error, but the description does not change Thank you!
  7. Hi Brian, the Smarty variable {$clientsdetails.companyname} return the company name of logged client, but I need to retrive the company names of all contacts of logged client. Thank you!
  8. Dear all, I'm trying to create a simple hook to list the company name of the clients, but I do not understand how to retrieve the userid of logged client Thank you! Best regards, Giorgio
  9. Hi all! I'm new in WHMCS and I'm trying to understand the function logics, so I apologize if my question may seem stupid... I'm trying to customize the "Six" template, in particular the file clientareacontacts.tpl in order to view the Company name in the select form of contact's client, instead of the full name and email. I've read the documentation: http://docs.whmcs.com/Template_Syntax#Custom_Template_Variables but I did not understand where to add a hook and how to use it. Please, can someone help me, even with only a simple example? Thank you for support! Regards, Giorgio
×
×
  • 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