Jump to content

tomdchi

Retired Forum Member
  • Posts

    245
  • Joined

  • Last visited

Everything posted by tomdchi

  1. No, no custom templates. There is no entry in gateway log. The error appears instantly so I suspect there is some javascript validation going on that it not working properly. What I have done to troubleshoot: copied over all template files just in case something was wrong there. cleared templates_c. copied over all files for stripe module. cleared cache in browser. So far nothing has worked.
  2. I am having problems with the stripe gateway module. When a customer goes to checkout and enters their CC info (not using saved card) and submits, an error saying that the expiration date is not valid is shown. The only way I have been able to get it to work is to go to Manage Credit Card in client area and add a credit card there. Then go back to shopping cart and select Use Existing Card. The order will go through OK doing it this way. Any idea what is wrong here? This is for WHMCS version 7.4.1.
  3. Sorry, but you reply makes no sense. How would being able to modify how many cycles an order will recur cause legal implications?? Using your logic, we should not be able to modify the recurring amount on an order. Having this tied to product only is not the best way to do this. If I have 100 products and need to have a recurring cycle limit set for each month of the year that would be 1200 products which is insane. Having the cycle limit set at the product level is fine but there needs to be a way to set a different limit at the time an order is generated.
  4. WHMCS v6 had a recurring cycles option for products but the problem with this is that there was no way to change the number of cycles for an order. Does anything in V7 change this? What I need to do is to be able to set the number of cycles when I am adding an order or at least change it after an order is added. It is not feasible for me to create multiples of the same product with different cycles.
  5. Currently the recurring cycles limit can only be set on a product. The problem I am having is if I have a customer that wants a different term. That means that I have to create a new product just for them. What would work better is if the limit was saved with the order and therefore could be changed. In other words the limit is dependent on the order and not the product.
  6. 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.
  7. 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.
  8. Using the InvoiceCreationPreEmail action hook you could update the description to say whatever you wanted. http://docs.whmcs.com/Hooks:InvoiceCreationPreEmail
  9. ===========DESCRIPTION=========== Problem occurs with configurable options are used. When invoice is generated a record is inserted into tblivnoiceitems for the setup fee and includes the type and a relid pointing to the record in tblhosting (when type is Hosting). The next record after the setup fee is the actual charge for the product. The entry in tblinvoiceitems shows the type as blank and the relid is 0. There is no way to reference this invoice item back to the product =========STEPS TO REPLICATE========= Create an invoice with an item that includes a setup fee or a configurable option that includes a setup fee
  10. I am working on a addon that needs to know what products are in the shopping cart and I am trying to use the hook PreCalculateCartTotals. The problem is that this hook doesn't give much useful info other than the product id. I thought I had a solution when I put the cartsummary.tpl into debug mode and the smarty debug console showed a very detailed $products array of everything in the cart. Array (1) 0 => Array (12) pid => "3" domain => "" billingcycle => "monthly" configoptions => "" customfields => Array (0) addons => Array (0) server => "" productinfo => Array (9) pid => "3" gid => "2" type => "other" groupname => "test" name => "blah blaha" description => "" freedomain => "" freedomainpaymentterms => Array (1) 0 => "" freedomaintlds => Array (1) 0 => "" allowqty => "1" qty => 1 pricing => Array (5) baseprice => "$125.00 USD" setup => "$0.00 USD" recurring => Array (1) Monthly => "$125.00 USD" totaltoday => "$125.00 USD" recurringexcltax => Array (1) Monthly => "$125.00 USD" pricingtext => "$125.00 USD" PERFECT...not so fast... In my hook function I am grabbing the smarty vars like this: global $smarty; $tpl_vars = $smarty->get_template_vars(); Thought I was golden until I realized that the $tpl_vars array is not the same as what is in the smarty debug console. The products array is not there at all. Anyone have an idea of how to get this products array from smarty? This array has to be somewhere. I looked in the session array and nothing was there so I don't know where its hiding.
  11. I would like to know this as well especially since php 5.5 will not support mysql in favor of mysqli and pdo.
  12. I am trying to figure out how to find the ID of a product based on the products on an invoice. From what I can tell, no link exists between invoice items (tblinvoiceitems) and the products (tblproducts) database tables. Am I missing something here?
  13. Here is what I have so far. It is not perfect but it seems to work pretty good. This assumes that the php file is in the admin dir and the tpl file is in admin/templates dir. The purpose of this page (for me) is client specific so that is why I have tried to make the tpl look like the current admin area client profile. PHP (there are two places in the file that need a admin username) <?php require('../dbconnect.php'); if (empty($_SESSION['adminid'])) { header("location: login.php"); exit (); } require('../includes/functions.php'); require('../includes/adminfunctions.php'); require('../includes/smarty/Smarty.class.php'); global $templates_compiledir; global $customadminpath; $smarty = new Smarty(); $smarty->template_dir = ROOTDIR . ('' . '/' . $customadminpath . '/templates/'); $smarty->compile_dir = $templates_compiledir; $table = 'tbladmins'; $fields = 'template'; $where = array('id' => $_SESSION['adminid']); $result = select_query($table, $fields, $where); $data = mysql_fetch_array($result); $template = empty($data['template']) ? 'blend' : $data['template']; $smarty->assign('template', $template); $smarty->assign('pagetitle', 'PageTitle'); $smarty->assign('sidebar', 'clients'); $adminpermsarray = array(0 => "Main Homepage", 1 => "Sidebar Statistics", 2 => "My Account", 3 => "List Clients", 4 => "List Services", 5 => "List Addons", 6 => "List Domains", 7 => "Add New Client", 8 => "Edit Clients Details", 9 => "View Credit Card Details", 10 => "View Clients Products/Services", 11 => "Edit Clients Products/Services", 12 => "Delete Clients Products/Services", 13 => "Perform Server Operations", 14 => "View Clients Domains", 15 => "Edit Clients Domains", 16 => "Delete Clients Domains", 17 => "View Clients Notes", 18 => "Add/Edit Client Notes", 19 => "Delete Client", 20 => "Mass Mail", 21 => "View Cancellation Requests", 22 => "Manage Affiliates", 23 => "View Orders", 24 => "Delete Order", 25 => "View Order Details", 26 => "Add New Order", 27 => "List Transactions", 28 => "Add Transaction", 29 => "Edit Transaction", 30 => "Delete Transaction", 31 => "View Gateway Log", 32 => "List Invoices", 33 => "Create Invoice", 34 => "Manage Invoice", 35 => "Delete Invoice", 36 => "Offline Credit Card Processing", 37 => "Support Center Overview", 38 => "Manage Announcements", 39 => "Manage Knowledgebase", 40 => "Manage Downloads", 41 => "List Support Tickets", 42 => "Open New Ticket", 43 => "Manage Predefined Replies", 44 => "View Reports", 45 => "Addon Modules", 46 => "Link Tracking", 47 => "Browser", 48 => "Calendar", 49 => "To-Do List", 50 => "WHOIS Lookups", 51 => "Domain Resolver Checker", 52 => "View Integration Code", 53 => "WHM Import Script", 54 => "Database Status", 55 => "System Cleanup Operations", 56 => "View PHP Info", 57 => "View Activity Log", 58 => "View Admin Log", 59 => "View Email Message Log", 60 => "View Ticket Mail Import Log", 61 => "View WHOIS Lookup Log", 62 => "Configure General Settings", 63 => "Configure Administrators", 64 => "Configure Admin Roles", 65 => "Configure Servers", 66 => "Configure Automation Settings", 67 => "Configure Payment Gateways", 68 => "Configure Tax Setup", 69 => "View Email Templates", 70 => "View Products/Services", 71 => "Configure Product Addons", 72 => "View Promotions", 73 => "Configure Domain Pricing", 74 => "Configure Support Departments", 75 => "Configure Spam Control", 76 => "Configure Banned Emails", 77 => "Configure Domain Registrars", 78 => "Configure Fraud Protection", 79 => "Configure Custom Client Fields", 80 => "API Access", 81 => "View Flagged Tickets", 82 => "Configure Database Backups", 83 => "Manage Network Issues", 84 => "Manage Quotes", 85 => "Configure Currencies", 86 => "Configure Security Questions", 87 => "CSV Downloads", 88 => "View Billable Items", 89 => "Manage Billable Items", 90 => "Configure Client Groups", 91 => "Refund Invoice Payments", 92 => "Delete Ticket", 93 => "View Income Totals", 94 => "Manage Clients Files", 95 => "Configure Ticket Statuses", 96 => "Delete Client Notes", 97 => "Perform Registrar Operations", 98 => "Create Upgrade/Downgrade Orders", 99 => "Configure Addon Modules", 100 => "Email Marketer", 101 => "Configure Product Bundles", 102 => "View Module Debug Log", 103 => "View Clients Summary", 104 => "View Support Ticket", 105 => "Decrypt Full Credit Card Number", 106 => "Update/Delete Stored Credit Card", 107 => "Create/Edit Promotions", 108 => "Delete Promotions", 109 => "View Banned IPs", 110 => "Add Banned IP", 111 => "Unban Banned IP", 112 => "Create/Edit Email Templates", 113 => "Delete Email Templates", 114 => "Manage Email Template Languages", 115 => "Create New Products/Services", 116 => "Edit Products/Services", 117 => "Delete Products/Services", 118 => "Manage Product Groups", 119 => "Allow Login as Client", 120 => "Configure Order Statuses", 121 => "Attempts CC Captures", 122 => "Generate Due Invoices", 123 => "Create Predefined Replies", 124 => "Create Predefined Replies", 125 => "Delete Predefined Replies", 126 => "Delete Predefined Replies", 127 => "Configure Two-Factor Authentication", 128 => "View Credit Log", 129 => "Manage Credits"); $smarty->assign('admin_perms', $adminpermsarray); require('lang/english.php'); $smarty->assign('_ADMINLANG', $_ADMINLANG); $results = localAPI('getclients', '', 'admin username with access to API'); $temp1 = array(); $temp2 = array(); foreach ($results['clients']['client'] as $value) { $temp1[] = $value['id']; if ($value['companyname'] == NULL) { $temp2[] = $value['firstname'] . ' ' . $value['lastname']; } else { $temp2[] = $value['firstname'] . ' ' . $value['lastname'] . ' - ' . $value['companyname']; } } $clients = array_combine($temp1, $temp2); $smarty->assign('clients', $clients); if (isset($_POST['userid'])) { $userid = $_POST['userid']; } else { $userid = $_GET['userid']; } if (!empty($userid)) { $clientsdetails = localAPI('getclientsdetails', array('clientid' => $userid, 'stats' => true), 'admin username with access to API'); $smarty->assign('clientsdetails', $clientsdetails['client']); $sidebarstats = array('orders' => array('pending' => 0), 'invoices' => array('overdue' => $clientsdetails['stats']['numoverdueinvoices']), 'tickets' => array('awaitingreply' => $clientsdetails['stats']['numactivetickets'])); $smarty->assign('sidebarstats', $sidebarstats); $smarty->assign('userid', $userid); } $smarty->display('admin_custom_page.tpl'); tpl file {include file="$template/header.tpl"} <form name=clientselect method="GET" action="{$smarty.server.PHP_SELF}?userid={$smarty.get.userid}"> Active Client: {html_options name=userid options=$clients selected=$userid style="width:265px;" onChange="submit();"} </form> <div id="clienttabs"> <ul> <li class="tab"><a href="clientssummary.php?userid={$clientsdetails.userid}">Summary</a></li> <li class="tab"><a href="clientsprofile.php?userid={$clientsdetails.userid}">Profile</a></li> <li class="tab"><a href="clientscontacts.php?userid={$clientsdetails.userid}">Contacts</a></li> <li class="tab"><a href="clientsservices.php?userid={$clientsdetails.userid}">Products/Services</a></li> <li class="tab"><a href="clientsdomains.php?userid={$clientsdetails.userid}">Domains</a></li> <li class="tab"><a href="clientsbillableitems.php?userid={$clientsdetails.userid}">Billable Items</a></li> <li class="tab"><a href="clientsinvoices.php?userid={$clientsdetails.userid}">Invoices</a></li> <li class="tab"><a href="clientsquotes.php?userid={$clientsdetails.userid}">Quotes</a></li> <li class="tab"><a href="clientstransactions.php?userid={$clientsdetails.userid}">Transactions</a></li> <li class="tab"><a href="clientsemails.php?userid={$clientsdetails.userid}">Emails</a></li> <li class="tab"><a href="clientsnotes.php?userid={$clientsdetails.userid}">Notes (0)</a></li> <li class="tab"><a href="clientslog.php?userid={$clientsdetails.userid}">Log</a></li> </ul> </div> <div id="tab0box" class="tabbox"> <div id="tab_content" style="text-align:left;"> <img src="images/spacer.gif" width="1" height="6"/><br/> <div style="font-size:18px;">#{$clientsdetails.userid} - {$clientsdetails.firstname} {$clientsdetails.lastname}</div> <img src="images/spacer.gif" width="1" height="6"/> <div> <!-- put html here --> </div> </div> </div> {include file="$template/footer.tpl"} The admin perms array was gathered from the smarty debug output. I am sure that there is a way to get the actual perms array so if anyone knows how to do it please let me know.
  14. Thanks but those are just tpl files. You would also need a php file to drive the tpl file. That is what is missing here. I am trying to figure this out by using trial and error. I will post back when I get it all figured out.
  15. That link is for client area not admin. Anyone have any examples of a custom page in the admin area?
  16. You wont be able to exclude but you can create overrides. The first thing you have to do is figure out which parts of the wordpress css is causing issues. These are what you need overrides for. A similar example for this is something I just did to override the WHMCS CSS that was messing with a custom page I had made on the client side. The css in bootstrap.css has this: input, textarea, select, .uneditable-input { display: inline-block; width: 210px; height: 18px; padding: 4px; margin-bottom: 9px; font-size: 13px; line-height: 18px; color: #555555; background-color: #ffffff; border: 1px solid #cccccc; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } The problem was that it was applying this to all input and select boxes and was messing up the display of my page. My pages tpl was enclosed in a div with the id sgpanel so I created a new css file called override.css and put this in it: #sgpanel input, textarea, select, .uneditable-input { display: inline-block; margin-bottom: 0; background-color: #ffffff; border: 1px solid #cccccc; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } At the top of the template for this page I included the css file override.css. This solved my problem and the same kind of thing should solve yours too but your going to have to do a lot more digging to find the problem css that needs overriden in wordpress.
  17. I am developing a tax module for WHMCS and trying to see the best way to implement it for the shopping cart. The taxes could have multiple types so the aim is to be able to itemize them in the shopping cart display. Using the action hook PreShoppingCartCheckout I can get all of the products in the cart and calculate what the tax list should be. The question now is if it is possible to modify the shopping cart display to show this list. When action hooks are used is there any kind of call back that can be used to direct the shopping cart to add more items?
  18. solved, apparently WHMCS runs post vars through html_encode.
  19. Is WHMCS doing something to php's json_decode function? I have a custom client page where a json string is being posted from a form. I can echo out the post var before I call json_decode and it shows OK. After decode I print_r the output nothing is returned. Very strange. Also, encoding is set to utf-8. When I echo the json post var it outputs OK: <?php define("CLIENTAREA", true); define("FORCESSL",true); require("init.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle("SureTax JSON Validator"); $ca->addToBreadCrumb('index.php', $whmcs->get_lang('globalsystemname')); $ca->addToBreadCrumb('json_validator.php', 'SureTax JSON Validator'); $ca->initPage(); if (isset($_POST['json'])) { $json = $_POST['json']; echo $json; exit; $decoded = json_decode($json, true); print_r($decoded); $ca->assign('validate', validate_json($json)); } Output: {"ClientNumber":"000000002","BusinessUnit":"RPS","DataYear":"2013","DataMonth":"04","TotalRevenue":"32.00"} Now when I try to run it through json_decode and print_r it outputs nothing. if (isset($_POST['json'])) { $json = $_POST['json']; $decoded = json_decode($json, true); print_r($decoded); exit; $ca->assign('validate', validate_json($json)); } Just to make sure that the json_decode function works I coded in the json string and the output was as expected. if (isset($_POST['json'])) { $json = '{"ClientNumber":"000000002","BusinessUnit":"RPS","DataYear":"2013","DataMonth":"04","TotalRevenue":"32.00"}'; $decoded = json_decode($json, true); print_r($decoded); exit; $ca->assign('validate', validate_json($json)); } Output: Array ( [ClientNumber] => 000000002 [businessUnit] => RPS [DataYear] => 2013 [DataMonth] => 04 [TotalRevenue] => 32.00 ) Anyone have any idea why it is doing this?
  20. We are not developing this module any longer so anyone needing QuickBooks for WHMCS should go to http://consolibyte.com/
  21. I have a custom credit card gateway where I would like to perform the validations using my code so I can return more descriptive errors. Is there any way to disable the WHMCS internal credit card validation in a custom gateway?
  22. Try a different browser. You either must have a small monitor or have your resolution set very low. If you can bump up the resolution it could solve your problem.
  23. is this your server - i.e. you have root access? What kind of OS is it and is there any kind of server management software on it (WHM)? The SMTP tweak in WHM can mess things up.
×
×
  • 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